diff --git a/django/__init__.py b/django/__init__.py index e69de29bb2..593e2f46e4 100644 --- a/django/__init__.py +++ b/django/__init__.py @@ -0,0 +1 @@ +VERSION = (0, 9, 1, 'SVN') diff --git a/django/core/management.py b/django/core/management.py index 5ea9539d25..46938b7642 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -63,6 +63,14 @@ def _is_valid_dir_name(s): # 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[3]: + v += ' (%s)' % VERSION[3] + return v + def get_sql_create(mod): "Returns a list of the CREATE TABLE SQL statements for the given module." from django.core import db, meta @@ -900,7 +908,7 @@ def print_error(msg, cmd): def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING): # Parse the command-line arguments. optparse handles the dirty work. - parser = DjangoOptionParser(get_usage(action_mapping)) + parser = DjangoOptionParser(usage=get_usage(action_mapping), version=get_version()) parser.add_option('--settings', 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.') parser.add_option('--pythonpath',