Ticket #4517: version.diff
File version.diff, 2.9 KB (added by , 17 years ago) |
---|
-
django/conf/global_settings.py
241 241 242 242 # The User-Agent string to use when checking for URL validity through the 243 243 # isExistingURL validator. 244 URL_VALIDATOR_USER_AGENT = "Django/0.96pre (http://www.djangoproject.com)" 244 from django import get_version 245 URL_VALIDATOR_USER_AGENT = "Django/%s (http://www.djangoproject.com)" % get_version() 245 246 246 247 ############## 247 248 # MIDDLEWARE # -
django/__init__.py
1 1 VERSION = (0, 97, 'pre') 2 3 def get_version(): 4 "Returns the version as a human-format string." 5 v = '.'.join([str(i) for i in VERSION[:-1]]) 6 if VERSION[-1]: 7 v += '-' + VERSION[-1] 8 return v -
django/core/management.py
20 20 {%% endif %%}''' 21 21 22 22 APP_ARGS = '[appname ...]' 23 DJANGO_VERSION = django.get_version() 23 24 24 25 # Use django.__path__[0] because we don't know which directory django into 25 26 # which has been installed. … … 93 94 # field as the field to which it points. 94 95 get_rel_data_type = lambda f: (f.get_internal_type() in ('AutoField', 'PositiveIntegerField', 'PositiveSmallIntegerField')) and 'IntegerField' or f.get_internal_type() 95 96 96 def get_version():97 "Returns the version as a human-format string."98 from django import VERSION99 v = '.'.join([str(i) for i in VERSION[:-1]])100 if VERSION[-1]:101 v += '-' + VERSION[-1]102 return v103 104 97 def get_sql_create(app): 105 98 "Returns a list of the CREATE TABLE SQL statements for the given app." 106 99 from django.db import get_creation_module, models … … 1172 1165 from django.conf import settings 1173 1166 print "Validating models..." 1174 1167 validate() 1175 print "\nDjango version %s, using settings %r" % ( get_version(), settings.SETTINGS_MODULE)1168 print "\nDjango version %s, using settings %r" % (DJANGO_VERSION, settings.SETTINGS_MODULE) 1176 1169 print "Development server is running at http://%s:%s/" % (addr, port) 1177 1170 print "Quit the server with %s." % quit_command 1178 1171 try: … … 1525 1518 argv = sys.argv 1526 1519 1527 1520 # Parse the command-line arguments. optparse handles the dirty work. 1528 parser = DjangoOptionParser(usage=get_usage(action_mapping), version= get_version())1521 parser = DjangoOptionParser(usage=get_usage(action_mapping), version=DJANGO_VERSION) 1529 1522 parser.add_option('--settings', 1530 1523 help='Python path to settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') 1531 1524 parser.add_option('--pythonpath',