获取Django的应用程序版本 [英] Get the version of Django for application
问题描述
唯一的方法是猜测。我将首先查看settings.py文件(或其他基础项目文件)的创建日期。
版本发布日期:
拥有您的urls.py:[ 4 ]
from django.conf.urls.defaults import *
from django.contrib import admin
或在应用程序中拥有一个 admin.py
[ 5 ]建议它是一个1.0+的项目。
拥有在您的urls.py中:[ 6 ]
(r'^ admin /',include(admin.site.urls)),
会建议1.1 +。
在您的设置中。 py文件:
DATABASES = {
'default':{
'NAME':'app_data' ,
'ENGINE':'django.db.backends.postgresql_psycopg2',
'USER':'postgres_user',
'PASSWORD':'s3krit'
},
'users':{
'NAME':'user_data',
'ENGINE':'django.db.backends.mysql',
'USER':'mysql_user',
'PASSWORD':'priv4te '
}
}
会建议1.2 +。
[1]: 1.1发行说明
[2]: 1.2发行说明
[3]: 1.3发行说明
[ 6]:多个数据库
I am starting a new (actually very old) project which I know is in Django. I am getting lost knowing the exact version of Django it has been build upon. Is there a way I can know the version of Django my application is running?
The only way is to take a guess. I would start by looking at the created date of the settings.py file (or other base project files)
Release dates for versions:
Having in your urls.py:[4]
from django.conf.urls.defaults import *
from django.contrib import admin
or having an admin.py
file in an application [5] suggests that it is a 1.0+ project.
Having in your urls.py: [6]
(r'^admin/', include(admin.site.urls)),
would suggest 1.1+.
Having in your settings.py file:
DATABASES = {
'default': {
'NAME': 'app_data',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'postgres_user',
'PASSWORD': 's3krit'
},
'users': {
'NAME': 'user_data',
'ENGINE': 'django.db.backends.mysql',
'USER': 'mysql_user',
'PASSWORD': 'priv4te'
}
}
would suggest 1.2+.
[1]: 1.1 release notes
[2]: 1.2 release notes
[3]: 1.3 release notes
[4]: Backwards Incompatible changes 0.96 > 1.0
[5]: Backwards Incompatible changes 0.96 > 1.0
[6]: Multiple databases
这篇关于获取Django的应用程序版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!