Enable Administrator features
The Django Administrator feature is not enabled by default-this is an optional option. To enable administrator functionality for your program, you need to do these three things:
1. Add "Django.contrib.admin" to the Installed_apps setting.
2. Run Python manage.py syncdb. When you add a new application to Installed_apps, the database table needs to be manually updated.
3. Edit file mysite/urls.py, uncomment "uncomment the next two lines ..." The line comments below. This file is a URL map.
Finally, your urls.py file should look like the following:
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^mysite/', include('mysite.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include ('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/(.*)', admin.site.root),
)
Start the development server
Let's start the development server and browse the admin page.
Python manage.py runserver
Now, open the browser and enter the "/admin/" in your local domain--htt://127.0.0.1:8000/admin/, for example. You will see the admin login interface: