How to upgrade my version of Django?

I am currently installing it and running a website.

http://www.djangoproject.com/download/ This is a new version. How to update it? (How do I install a new version on top of the current one?)

+6
python django
source share
2 answers

read about it in:

http://docs.djangoproject.com/en/dev/topics/install/

To install Django to upgrade to the latest code on the trunk:

If you want to update your Django code sometimes with the latest bug fixes and improvements, follow these steps:

1. Make sure that you have Subversion installed, and that you can run its commands from the shell. (Type svn help at the command line to verify this.)

2. Check the main Django development branch ("trunk") as follows:

svn co http://code.djangoproject.com/svn/django/trunk/ 3.Next django trunk, make sure the Python interpreter can load the Django code. There are various ways of doing this. One of the many convenient ones on Linux, Mac OSX, or other Unix-like systems is to use a symbolic link:

ln -s pwd / django-trunk / django SITE-PACKAGES-DIR / django (In the line above, change SITE-PACKAGES-DIR to match the location of your system to the package site directory, as explained in the section β€œWhere are my package sites” saved? "above.)

Alternatively, you can define the PYTHONPATH environment variable, so that it includes a django-trunk directory. This is perhaps the most convenient solution for Windows systems that do not support symbolic links. (Environment variables can be defined on Windows systems from Control Panel.)

What about Apache and mod_python?

If you take the PYTHONPATH configuration approach, you need to remember to do the same in your Apache when deploying the production site. Do this by installing PythonPath in your Apache configuration file.

Additional deployment information is available, of course, in our use of Django with the mod_python documentation.

4. On Unix-like systems, create a symbolic link to the Django-trunk / Django / bin / django-admin.py file in a directory on your system path, for example / usr / local / bin. For example:

ln -s pwd /django-trunk/django/bin/django-admin.py / usr / local / bin This simply allows you to enter django-admin.py from anywhere, rather than qualifying the command with the full path to the file.

On Windows systems, the same result can be achieved by copying the Django-trunk / Django / bin / django-admin.py file somewhere on the way to your system, for example C: \ Python24 \ Scripts.

You do not need to run the python setup.py install because you have already completed the equivalent steps in steps 3 and 4.

If you want to update your copy of the Django source code, just run the svn update command from within the django-trunk directory. When you do this, Subversion will automatically download any changes.

To upgrade Django from a stable release to another stable release:

If you upgrade your Django installation from a previous version, you will need to uninstall the old version of Django before installing the new version.

If you installed Django using setup.py install, uninstalling is just like removing the django directory from your Python site packages.

If you installed Django from a Python egg, remove the Django.egg file and remove the link to the egg in a file named simple install.pth. This file should also be located in your site directory.

+5
source share

First of all, no need. First install / upgrade it on an intermediate server and check your application to make sure it is still running. Only after full testing should you upgrade to the new version on your website.

+5
source share

All Articles