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.
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.