加入收藏 | 设为首页 | 会员中心 | 我要投稿 商洛站长网 (https://www.0914zz.com/)- AI应用、CDN、边缘计算、云计算、物联网!
当前位置: 首页 > 编程开发 > Python > 正文

python – 如何更新我的Django版本?

发布时间:2021-03-31 00:01:39 所属栏目:Python 来源:互联网
导读:我目前安装了它,并且正在运行一个网站. http://www.djangoproject.com/download/ 这是新版本.我该如何升级呢? (如何在当前版本上安装新版本?) 在下面阅读: http://docs.djangoproject.com/en/dev/topics/install/ 要安装Django以便能够更新到trunk中的最新

我目前安装了它,并且正在运行一个网站.

http://www.djangoproject.com/download/
这是新版本.我该如何升级呢? (如何在当前版本上安装新版本?)

解决方法

在下面阅读:

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

要安装Django以便能够更新到trunk中的最新代码:

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
07001
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:Python24Scripts.

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

用于将Django从稳定版本更新到另一个稳定版本:

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

If you installed Django using setup.py install,uninstalling is as
simple as deleting the django directory from your Python
site-packages.

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

(编辑:商洛站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读