Friday, February 10, 2012

Checklist for enabling the Admin interface in Django

1. Make sure you have the following apps in INSTALLED_APPS
'django.contrib.admin'
'django.contrib.auth'
'django.contrib.contenttypes'
'django.contrib.sessions'

2. Make sure you have the following in MiddleWare
django.middleware.common.CommonMiddleware'
'django.contrib.sessions.middleware.SessionMiddleware'
'django.contrib.auth.middleware.AuthenticationMiddleware'

3. Add the admin site to URLConf
4. Ensure urls.py imports admin
5. Ensure autodiscover is on in urls.py
6. Add your models to the admin site by updating admin.py in your app directorie(s)
admin.site.register(Publisher)
...
7. python manage.py syncdb
8. Create the superuser when asked
9. Run the website and check

No comments:

Post a Comment