Django

Code

Changeset 8027

Show
Ignore:
Timestamp:
07/21/08 12:10:33 (6 months ago)
Author:
jacob
Message:

Improved the bit of the tutorial that explains how to enable the admin. Fixes #7824.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/tutorial02.txt

    r7984 r8027  
    3030 
    3131    * Add ``"django.contrib.admin"`` to your ``INSTALLED_APPS`` setting. 
     32     
    3233    * Run ``python manage.py syncdb``. Since you have added a new application 
    3334      to ``INSTALLED_APPS``, the database tables need to be updated. 
     35       
    3436    * Edit your ``mysite/urls.py`` file and uncomment the lines below the 
    3537      "Uncomment this for admin:" comments. This file is a URLconf; we'll dig 
    3638      into URLconfs in the next tutorial. For now, all you need to know is that 
    37       it maps URL roots to applications. 
     39      it maps URL roots to applications. In the end, you should have a 
     40      ``urls.py`` file that looks like this: 
     41       
     42      .. parsed-literal:: 
     43       
     44          from django.conf.urls.defaults import * 
     45 
     46          # Uncomment the next two lines to enable the admin: 
     47          **from django.contrib import admin** 
     48          **admin.autodiscover()** 
     49 
     50          urlpatterns = patterns('', 
     51              # Example: 
     52              # (r'^{{ project_name }}/', include('{{ project_name }}.foo.urls')), 
     53 
     54              # Uncomment the next line to enable admin documentation: 
     55              # (r'^admin/doc/', include('django.contrib.admindocs.urls')), 
     56 
     57              # Uncomment the next line for to enable the admin: 
     58              **(r'^admin/(.*)', admin.site.root),** 
     59          ) 
     60           
     61      (The bold lines are the ones that needed to be uncommented.) 
    3862 
    3963Start the development server