Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #4517 -- Made sure that URL_VALIDATOR_USER_AGENT includes the u…

…p-to-date

Django version number. Thanks, James Wheare.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5451 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 130c7eee8058847083ad58f1f9abdcf51e879032 1 parent 6fc10f5
@malcolmt malcolmt authored
View
1  AUTHORS
@@ -234,6 +234,7 @@ answer newbie questions, and generally made Django that much better:
wangchun <yaohua2000@gmail.com>
Dan Watson <http://theidioteque.net/>
Chris Wesseling <Chris.Wesseling@cwi.nl>
+ James Wheare <django@sparemint.com>
charly.wilhelm@gmail.com
Rachel Willmer <http://www.willmer.com/kb/>
Gary Wilson <gary.wilson@gmail.com>
View
7 django/__init__.py
@@ -1 +1,8 @@
VERSION = (0, 97, 'pre')
+
+def get_version():
+ "Returns the version as a human-format string."
+ v = '.'.join([str(i) for i in VERSION[:-1]])
+ if VERSION[-1]:
+ v += '-' + VERSION[-1]
+ return v
View
3  django/conf/global_settings.py
@@ -241,7 +241,8 @@
# The User-Agent string to use when checking for URL validity through the
# isExistingURL validator.
-URL_VALIDATOR_USER_AGENT = "Django/0.96pre (http://www.djangoproject.com)"
+from django import get_version
+URL_VALIDATOR_USER_AGENT = "Django/%s (http://www.djangoproject.com)" % get_version()
##############
# MIDDLEWARE #
View
13 django/core/management.py
@@ -3,14 +3,17 @@
import django
from django.core.exceptions import ImproperlyConfigured
-import os, re, shutil, sys, textwrap
from optparse import OptionParser
from django.utils import termcolors
+import os, re, shutil, sys, textwrap
# For Python 2.3
if not hasattr(__builtins__, 'set'):
from sets import Set as set
+# For backwards compatibility: get_version() used to be in this module.
+get_version = django.get_version
+
MODULE_TEMPLATE = ''' {%% if perms.%(app)s.%(addperm)s or perms.%(app)s.%(changeperm)s %%}
<tr>
<th>{%% if perms.%(app)s.%(changeperm)s %%}<a href="%(app)s/%(mod)s/">{%% endif %%}%(name)s{%% if perms.%(app)s.%(changeperm)s %%}</a>{%% endif %%}</th>
@@ -93,14 +96,6 @@ def _get_sequence_list():
# field as the field to which it points.
get_rel_data_type = lambda f: (f.get_internal_type() in ('AutoField', 'PositiveIntegerField', 'PositiveSmallIntegerField')) and 'IntegerField' or f.get_internal_type()
-def get_version():
- "Returns the version as a human-format string."
- from django import VERSION
- v = '.'.join([str(i) for i in VERSION[:-1]])
- if VERSION[-1]:
- v += '-' + VERSION[-1]
- return v
-
def get_sql_create(app):
"Returns a list of the CREATE TABLE SQL statements for the given app."
from django.db import get_creation_module, models
Please sign in to comment.
Something went wrong with that request. Please try again.