Playing with the admin system
Before we can use the built-in admin application, we will need to enable it. This involves adding the admin application to the project, syncing the database, telling the admin application about our database objects, and adding the admin URLs to our urls.py
file. Let's work through each of these in turn:
Adding the admin application to the project:
Edit your
settings.py
file and uncomment the'django.contrib.admin'
line within theINSTALLED_APPS
list:INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', # Uncomment the next line to enable the admin: 'django.contrib.admin', 'django.contrib.gis', 'shapeEditor' )
Resynchronizing the database:
From the command line,
cd
into your GeoDjango project directory and type the following:python manage.py syncdb
This will add the admin application's tables to your database.
Adding our database objects...