Django

Code

Changeset 948

Show
Ignore:
Timestamp:
10/18/05 20:09:05 (3 years ago)
Author:
adrian
Message:

Fixed #627 -- BACKWARDS-INCOMPATIBLE CHANGE. Admin is now an app, not a middleware. See BackwardsIncompatibleChanges for a full list of changes and information on how to update your code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/project_template/settings.py

    r892 r948  
    2828MEDIA_URL = '' 
    2929 
     30# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a 
     31# trailing slash. 
     32# Examples: "http://foo.com/media/", "/media/". 
     33ADMIN_MEDIA_PREFIX = '/media/' 
     34 
    3035# Make this unique, and don't share it with anybody. 
    3136SECRET_KEY = '' 
     
    3338# List of callables that know how to import templates from various sources. 
    3439TEMPLATE_LOADERS = ( 
    35 #     'django.core.template.loaders.app_directories.load_template_source', 
    3640    'django.core.template.loaders.filesystem.load_template_source', 
     41    'django.core.template.loaders.app_directories.load_template_source', 
    3742#     'django.core.template.loaders.eggs.load_template_source', 
    3843) 
     
    4045MIDDLEWARE_CLASSES = ( 
    4146    "django.middleware.common.CommonMiddleware", 
     47    "django.middleware.sessions.SessionMiddleware", 
    4248    "django.middleware.doc.XViewMiddleware", 
    4349) 
    4450 
    45 ROOT_URLCONF = '{{ project_name }}.settings.urls.main
     51ROOT_URLCONF = '{{ project_name }}.urls
    4652 
    4753TEMPLATE_DIRS = ( 
  • django/trunk/django/conf/project_template/urls.py

    r124 r948  
    44    # Example: 
    55    # (r'^{{ project_name }}/', include('{{ project_name }}.apps.foo.urls.foo')), 
     6 
     7    # Uncomment this for admin: 
     8#     (r'^admin/', include('django.contrib.admin.urls.admin')), 
    69) 
  • django/trunk/django/contrib/admin/templates/admin/404.html

    r92 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block title %}Page not found{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin/500.html

    r92 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; Server error</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin/base_site.html

    r183 r948  
    1 {% extends "base" %} 
     1{% extends "admin/base" %} 
    22 
    33{% block title %}{{ title }} | Django site admin{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin/delete_confirmation.html

    r92 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block content %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/bookmarklets.html

    r337 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Bookmarklets</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/index.html

    r391 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Documentation</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/missing_docutils.html

    r337 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Documentation</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/model_detail.html

    r337 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block extrahead %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/model_index.html

    r337 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block coltype %}colSM{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/template_detail.html

    r392 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; Templates &rsaquo; {{ name }}</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/template_filter_index.html

    r337 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block coltype %}colSM{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/template_tag_index.html

    r337 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block coltype %}colSM{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/view_detail.html

    r337 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; <a href="../">Views</a> &rsaquo; {{ name }}</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin_doc/view_index.html

    r391 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block coltype %}colSM{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin/index.html

    r684 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block coltype %}colMS{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin/login.html

    r123 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin/object_history.html

    r92 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %} 
  • django/trunk/django/contrib/admin/templates/admin/template_validator.html

    r92 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block content %} 
  • django/trunk/django/contrib/admin/templates/registration/logged_out.html

    r326 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a></div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/registration/password_change_done.html

    r327 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Password change</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/registration/password_change_form.html

    r327 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Password change</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/registration/password_reset_done.html

    r327 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Password reset</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templates/registration/password_reset_form.html

    r327 r948  
    1 {% extends "base_site" %} 
     1{% extends "admin/base_site" %} 
    22 
    33{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Password reset</div>{% endblock %} 
  • django/trunk/django/contrib/admin/templatetags/log.py

    r549 r948  
    1 from django.models.auth import log 
     1from django.models.admin import log 
    22from django.core import template 
    33 
  • django/trunk/django/contrib/admin/views/main.py

    r931 r948  
    77from django.core.extensions import DjangoContext as Context 
    88from django.core.extensions import get_object_or_404, render_to_response 
    9 from django.models.auth import log 
     9from django.models.admin import log 
    1010from django.utils.html import strip_tags 
    1111from django.utils.httpwrappers import HttpResponse, HttpResponseRedirect 
     
    5050 
    5151def index(request): 
    52     return render_to_response('index', {'title': 'Site administration'}, context_instance=Context(request)) 
     52    return render_to_response('admin/index', {'title': 'Site administration'}, context_instance=Context(request)) 
    5353index = staff_member_required(index) 
    5454 
     
    267267                pass # Invalid argument to "list_filter" 
    268268 
    269     raw_template = ['{% extends "base_site" %}\n'] 
     269    raw_template = ['{% extends "admin/base_site" %}\n'] 
    270270    raw_template.append('{% block bodyclass %}change-list{% endblock %}\n') 
    271271    if not is_popup: 
     
    539539    ordered_objects = opts.get_ordered_objects()[:] 
    540540    auto_populated_fields = [f for f in opts.fields if f.prepopulate_from] 
    541     t = ['{% extends "base_site" %}\n'] 
     541    t = ['{% extends "admin/base_site" %}\n'] 
    542542    t.append('{% block extrahead %}') 
    543543 
     
    10881088        request.user.add_message('The %s "%s" was deleted successfully.' % (opts.verbose_name, obj_repr)) 
    10891089        return HttpResponseRedirect("../../") 
    1090     return render_to_response('delete_confirmation_generic', { 
     1090    return render_to_response('admin/delete_confirmation', { 
    10911091        "title": "Are you sure?", 
    10921092        "object_name": opts.verbose_name, 
     
    11031103    # If no history was found, see whether this object even exists. 
    11041104    obj = get_object_or_404(mod, pk=object_id) 
    1105     return render_to_response('admin_object_history', { 
     1105    return render_to_response('admin/object_history', { 
    11061106        'title': 'Change history: %r' % obj, 
    11071107        'action_list': action_list, 
  • django/trunk/django/contrib/admin/views/template.py

    r929 r948  
    2424        if not errors: 
    2525            request.user.add_message('The template is valid.') 
    26     return render_to_response('template_validator', { 
     26    return render_to_response('admin/template_validator', { 
    2727        'title': 'Template validator', 
    2828        'form': formfields.FormWrapper(manipulator, new_data, errors), 
  • django/trunk/django/core/management.py

    r823 r948  
    1818# which has been installed. 
    1919PROJECT_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', '%s_template') 
    20 ADMIN_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', 'admin_templates') 
    2120 
    2221def _get_packages_insert(app_label): 
     
    143142        cursor.execute("SELECT id FROM content_types WHERE package = %s", [app_label]) 
    144143        for row in cursor.fetchall(): 
    145             output.append("DELETE FROM auth_admin_log WHERE content_type_id = %s;" % row[0]) 
     144            output.append("DELETE FROM django_admin_log WHERE content_type_id = %s;" % row[0]) 
    146145 
    147146    # Close database connection explicitly, in case this output is being piped 
     
    379378    from random import choice 
    380379    _start_helper('project', project_name, directory) 
    381     # Populate TEMPLATE_DIRS for the admin templates, based on where Django is 
    382     # installed. 
    383     admin_settings_file = os.path.join(directory, project_name, 'settings', 'admin.py') 
    384     settings_contents = open(admin_settings_file, 'r').read() 
    385     fp = open(admin_settings_file, 'w') 
    386     settings_contents = re.sub(r'(?s)\b(TEMPLATE_DIRS\s*=\s*\()(.*?)\)', "\\1\n    r%r,\\2)" % ADMIN_TEMPLATE_DIR, settings_contents) 
    387     fp.write(settings_contents) 
    388     fp.close() 
    389380    # Create a random SECRET_KEY hash, and put it in the main settings. 
    390     main_settings_file = os.path.join(directory, project_name, 'settings', 'main.py') 
     381    main_settings_file = os.path.join(directory, project_name, 'settings.py') 
    391382    settings_contents = open(main_settings_file, 'r').read() 
    392383    fp = open(main_settings_file, 'w') 
  • django/trunk/django/core/servers/basehttp.py

    r575 r948  
    603603        import django 
    604604        self.application = application 
    605         self.media_dir = django.__path__[0] + '/conf/admin_media' 
     605        self.media_dir = django.__path__[0] + '/contrib/admin/media' 
    606606        self.media_url = settings.ADMIN_MEDIA_PREFIX 
    607607 
  • django/trunk/django/models/auth.py

    r938 r948  
    177177    def __repr__(self): 
    178178        return self.message 
    179  
    180 class LogEntry(meta.Model): 
    181     action_time = meta.DateTimeField(auto_now=True) 
    182     user = meta.ForeignKey(User) 
    183     content_type = meta.ForeignKey(core.ContentType, blank=True, null=True) 
    184     object_id = meta.TextField(blank=True, null=True) 
    185     object_repr = meta.CharField(maxlength=200) 
    186     action_flag = meta.PositiveSmallIntegerField() 
    187     change_message = meta.TextField(blank=True) 
    188     class META: 
    189         module_name = 'log' 
    190         verbose_name_plural = 'log entries' 
    191         db_table = 'auth_admin_log' 
    192         ordering = ('-action_time',) 
    193         module_constants = { 
    194             'ADDITION': 1, 
    195             'CHANGE': 2, 
    196             'DELETION': 3, 
    197         } 
    198  
    199     def __repr__(self): 
    200         return str(self.action_time) 
    201  
    202     def is_addition(self): 
    203         return self.action_flag == ADDITION 
    204  
    205     def is_change(self): 
    206         return self.action_flag == CHANGE 
    207  
    208     def is_deletion(self): 
    209         return self.action_flag == DELETION 
    210  
    211     def get_edited_object(self): 
    212         "Returns the edited object represented by this log entry" 
    213         return self.get_content_type().get_object_for_this_type(pk=self.object_id) 
    214  
    215     def get_admin_url(self): 
    216         """ 
    217         Returns the admin URL to edit the object represented by this log entry. 
    218         This is relative to the Django admin index page. 
    219         """ 
    220         return "%s/%s/%s/" % (self.get_content_type().package, self.get_content_type().python_module_name, self.object_id) 
    221  
    222     def _module_log_action(user_id, content_type_id, object_id, object_repr, action_flag, change_message=''): 
    223         e = LogEntry(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message) 
    224         e.save() 
  • django/trunk/docs/django-admin.txt

    r900 r948  
    193193Example usage:: 
    194194 
    195     django-admin.py init --settings='myproject.settings.main' 
     195    django-admin.py init --settings=myproject.settings 
    196196 
    197197Explicitly specifies the settings module to use. The settings module should be 
    198 in Python path syntax, e.g. "myproject.settings.main". If this isn't provided, 
     198in Python path syntax, e.g. "myproject.settings". If this isn't provided, 
    199199``django-admin.py`` will use the DJANGO_SETTINGS_MODULE environment variable. 
    200200 
  • django/trunk/docs/faq.txt

    r653 r948  
    349349      to match your domain. For example, if you're going to 
    350350      "http://www.mysite.com/admin/" in your browser, in 
    351       "myproject.settings.admin" you should set ``SESSION_COOKIE_DOMAIN = 
    352       'www.mysite.com'``. 
     351      "myproject.settings" you should set ``SESSION_COOKIE_DOMAIN = 'www.mysite.com'``. 
    353352 
    354353    * Some browsers (Firefox?) don't like to accept cookies from domains that 
  • django/trunk/docs/middleware.txt

    r880 r948  
    2828    ) 
    2929 
    30 The default admin site has the following ``MIDDLEWARE_CLASSES`` set:: 
    31  
    32     MIDDLEWARE_CLASSES = ( 
    33         "django.middleware.sessions.SessionMiddleware", 
    34         "django.middleware.admin.AdminUserRequired", 
    35         "django.middleware.common.CommonMiddleware", 
    36     ) 
    37  
    3830Django applies middleware in the order it's defined in ``MIDDLEWARE_CLASSES``. 
    3931 
    40 For a regular (i.e., non-admin) Django installation, no middleware is required, 
    41 but it's strongly suggested that you use ``CommonMiddleware``. For a Django 
    42 admin site, ``SessionMiddleware`` and ``AdminUserRequired`` (in that order) are 
    43 required. 
     32A Django installation doesn't require any middleware -- e.g., 
     33``MIDDLEWARE_CLASSES`` can be empty, if you'd like -- but it's strongly 
     34suggested that you use ``CommonMiddleware``. 
    4435 
    4536Available middleware 
    4637==================== 
    47  
    48 django.middleware.admin.AdminUserRequired 
    49 ----------------------------------------- 
    50  
    51 Limits site access to valid users with the ``is_staff`` flag set. This is 
    52 required by Django's admin, and this middleware requires ``SessionMiddleware``. 
    5338 
    5439django.middleware.cache.CacheMiddleware 
  • django/trunk/docs/modpython.txt

    r845 r948  
    2626        SetHandler python-program 
    2727        PythonHandler django.core.handlers.modpython 
    28         SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main 
     28        SetEnv DJANGO_SETTINGS_MODULE myproject.settings 
    2929        PythonDebug On 
    3030    </Location> 
    3131 
    32 ...and replace ``myproject.settings.main`` with the Python path to your 
    33 settings file. 
     32...and replace ``myproject.settings`` with the Python path to your settings file. 
    3433 
    3534This tells Apache: "Use mod_python for any URL at or under '/mysite/', using the 
     
    5655time you make changes to your Python code. 
    5756 
    58 Here's a template for an admin configuration:: 
    59  
    60     <Location "/admin/"> 
    61         SetHandler python-program 
    62         PythonHandler django.core.handlers.modpython 
    63         SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin 
    64         PythonDebug On 
    65     </Location> 
    66  
    67 The only thing different here is the ``DJANGO_SETTINGS_MODULE``. 
    68  
    6957Multiple Django installations on the same Apache 
    7058================================================ 
     
    7866        ServerName www.example.com 
    7967        # ... 
    80         SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main 
     68        SetEnv DJANGO_SETTINGS_MODULE myproject.settings 
    8169    </VirtualHost> 
    8270 
    8371    <VirtualHost *> 
    84         ServerName admin.example.com 
     72        ServerName www2.example.com 
    8573        # ... 
    86         SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin 
     74        SetEnv DJANGO_SETTINGS_MODULE myproject.other_settings 
    8775    </VirtualHost> 
    8876 
     
    9684        # ... 
    9785        <Location "/something"> 
    98             SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main 
    99             PythonInterpreter myproject_main 
     86            SetEnv DJANGO_SETTINGS_MODULE myproject.settings 
     87            PythonInterpreter myproject 
    10088        </Location> 
    10189 
    102         <Location "/admin"> 
    103             SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin 
    104             PythonInterpreter myproject_admin 
     90        <Location "/otherthing"> 
     91            SetEnv DJANGO_SETTINGS_MODULE myproject.other_settings 
     92            PythonInterpreter myproject_other 
    10593        </Location> 
    10694    </VirtualHost> 
  • django/trunk/docs/settings.txt

    r902 r948  
    3535 
    3636The value of ``DJANGO_SETTINGS_MODULE`` should be in Python path syntax, e.g. 
    37 ``"myproject.settings.main"``. Note that the settings module should be on the 
     37``"myproject.settings"``. Note that the settings module should be on the 
    3838Python `import search path`_. 
    3939 
     
    4848Example (Unix Bash shell):: 
    4949 
    50     export DJANGO_SETTINGS_MODULE=myproject.settings.main 
     50    export DJANGO_SETTINGS_MODULE=myproject.settings 
    5151    django-admin.py runserver 
    5252 
    5353Example (Windows shell):: 
    5454 
    55     set DJANGO_SETTINGS_MODULE=myproject.settings.main 
     55    set DJANGO_SETTINGS_MODULE=myproject.settings 
    5656    django-admin.py runserver 
    5757 
    5858Use the ``--settings`` command-line argument to specify the settings manually:: 
    5959 
    60     django-admin.py runserver --settings=myproject.settings.main 
     60    django-admin.py runserver --settings=myproject.settings 
    6161 
    6262.. _django-admin.py: http://www.djangoproject.com/documentation/django_admin/ 
     
    7171        SetHandler python-program 
    7272        PythonHandler django.core.handlers.modpython 
    73         SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main 
     73        SetEnv DJANGO_SETTINGS_MODULE myproject.settings 
    7474    </Location> 
    7575 
  • django/trunk/docs/tutorial01.txt

    r747 r948  
    4141        apps/ 
    4242            __init__.py 
    43         settings/ 
    44             __init__.py 
    45             admin.py 
    46             main.py 
    47             urls/ 
    48                 __init__.py 
    49                 admin.py 
    50                 main.py 
    51  
    52 First, edit ``myproject/settings/main.py``. It's a normal Python module with 
     43        settings.py 
     44        urls.py 
     45 
     46First, edit ``myproject/settings.py``. It's a normal Python module with 
    5347module-level variables representing Django settings. Edit the file and change 
    5448these settings to match your database's connection parameters: 
     
    7064    database's interactive prompt. 
    7165 
    72     Also, note that MySQL and sqlite support is a recent development, and Django 
    73     hasn't been comprehensively tested with either database. If you find any 
    74     bugs in those bindings, please file them in `Django's ticket system`_ so we 
    75     can fix them immediately. 
    76  
    7766Now, take a second to make sure ``myproject`` is on your Python path. You 
    7867can do this by copying ``myproject`` to Python's ``site-packages`` directory, 
     
    8574Run the following command:: 
    8675 
    87     django-admin.py init --settings=myproject.settings.main 
     76    django-admin.py init --settings=myproject.settings 
    8877 
    8978The ``django-admin.py`` utility generally needs to know which settings module 
     
    9382how you do that in the Bash shell on Unix:: 
    9483 
    95     export DJANGO_SETTINGS_MODULE=myproject.settings.main 
     84    export DJANGO_SETTINGS_MODULE=myproject.settings 
    9685 
    9786On Windows, you'd use ``set`` instead:: 
    9887 
    99     set DJANGO_SETTINGS_MODULE=myproject.settings.main 
     88    set DJANGO_SETTINGS_MODULE=myproject.settings 
    10089 
    10190If you don't see any errors after running ``django-admin.py init``, you know it 
     
    222211   a given Django installation. 
    223212 
    224 Edit the myproject/settings/main.py file again, and change the ``INSTALLED_APPS`` 
     213Edit the myproject/settings.py file again, and change the ``INSTALLED_APPS`` 
    225214setting to include the string "myproject.apps.polls". So it'll look like this:: 
    226215 
  • django/trunk/docs/tutorial02.txt

    r596 r948  
    2525    managers. 
    2626 
     27Activate the admin site 
     28======================= 
     29 
     30The Django admin site is not activated by default -- it's an opt-in thing. To 
     31activate the admin site for your installation, do these three things: 
     32 
     33    * Add ``"django.contrib.admin"`` to your ``INSTALLED_APPS`` setting. 
     34    * Run the command ``django-admin.py install admin``. This will create an 
     35      extra database table that the admin needs. 
     36    * Edit your ``myproject.urls`` file and uncomment the line below 
     37      "Uncomment this for admin:". This file is a URLconf; we'll dig into 
     38      URLconfs in the next tutorial. For now, all you need to know is that it 
     39      maps URL roots to applications. 
     40 
    2741Create a user account 
    2842===================== 
     
    3044Run the following command to create a superuser account for your admin site:: 
    3145 
    32     django-admin.py createsuperuser --settings="myproject.settings.main" 
    33  
    34 (Note: You can use either "myproject.settings.main" or "myproject.settings.admin" 
    35 here. They both reference the same database.) 
     46    django-admin.py createsuperuser --settings=myproject.settings 
    3647 
    3748The script will prompt you for a username, e-mail address and password (twice). 
     
    4657Just run the following command to start the server:: 
    4758 
    48     django-admin.py runserver --settings="myproject.settings.admin" 
     59    django-admin.py runserver --settings=myproject.settings 
    4960 
    5061It'll start a Web server running locally -- on port 8000, by default. If you 
    5162want to change the server's port, pass it as a command-line argument:: 
    5263 
    53     django-admin.py runserver 8080 --settings="myproject.settings.admin" 
     64    django-admin.py runserver 8080 --settings=myproject.settings 
    5465 
    5566