python怎么升级django_如何更新我的Django版本?

If you'd like to be able to update

your Django code occasionally with the

latest bug fixes and improvements,

follow these instructions:

1.Make sure that you have Subversion installed, and that you can run its

commands from a shell. (Enter svn help

at a shell prompt to test this.)

2.Check out Django's main development branch (the 'trunk') like so:

svn co

http://code.djangoproject.com/svn/django/trunk/

django-trunk

3.Next, make sure that the Python interpreter can load Django's code.

There are various ways of

accomplishing this. One of the most

convenient, 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 above

line, change SITE-PACKAGES-DIR to

match the location of your system's

site-packages directory, as explained

in the "Where are my site-packages

stored?" section above.)

Alternatively, you can define your

PYTHONPATH environment variable so

that it includes the django-trunk

directory. This is perhaps the most

convenient solution on Windows

systems, which don't support symbolic

links. (Environment variables can be

defined on Windows systems from the

Control Panel.)

What about Apache and mod_python?

If you take the approach of setting

PYTHONPATH, you'll need to remember to

do the same thing in your Apache

configuration once you deploy your

production site. Do this by setting

PythonPath in your Apache

configuration file.

More information about deployment is

available, of course, in our How to

use Django with mod_python

documentation.

4.On Unix-like systems, create a symbolic link to the file

django-trunk/django/bin/django-admin.py

in a directory on your system path,

such as /usr/local/bin. For example:

ln -s

pwd/django-trunk/django/bin/django-admin.py

/usr/local/bin This simply lets you

type django-admin.py from within any

directory, rather than having to

qualify the command with the full path

to the file.

On Windows systems, the same result

can be achieved by copying the file

django-trunk/django/bin/django-admin.py

to somewhere on your system path, for

example C:\Python24\Scripts.

You don't have to run python setup.py

install, because you've already

carried out the equivalent actions in

steps 3 and 4.

When you want to update your copy of

the Django source code, just run the

command svn update from within the

django-trunk directory. When you do

this, Subversion will automatically

download any changes

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值