Django - Admin Interface


Django provides a ready-to-use user interface for administrative activities. We all know how an admin interface is important for a web project. Django automatically generates admin UI based on your project models.

Starting the Admin Interface

The Admin interface depends on the django.countrib module. To have it working you need to make sure some modules are imported in the INSTALLED_APPS and MIDDLEWARE_CLASSES tuples of the myproject/ file.

For INSTALLED_APPS make sure you have −




Before launching your server, to access your Admin Interface, you need to initiate the database −

$ python migrate

syncdb will create necessary tables or collections depending on your db type, necessary for the admin interface to run. Even if you don't have a superuser, you will be prompted to create one.

If you already have a superuser or have forgotten it, you can always create one using the following code −

$ python createsuperuser

Now to start the Admin Interface, we need to make sure we have configured a URL for our admin interface. Open the myproject/ and you should have something like −

from django.conf.urls import patterns, include, url

from django.contrib import admin

urlpatterns = patterns('',
   # Examples:
   # url(r'^$', 'myproject.views.home', name = 'home'),
   # url(r'^blog/', include('blog.urls')),

   url(r'^admin/', include(,

Now just run the server.

$ python runserver

And your admin interface is accessible at:

Admin Interface

Once connected with your superuser account, you will see the following screen −

Super User Account

That interface will let you administrate Django groups and users, and all registered models in your app. The interface gives you the ability to do at least the "CRUD" (Create, Read, Update, Delete) operations on your models.

Useful Video Courses


Build a Stock Market Web App With Python and Django

Best Seller

39 Lectures 3.5 hours

John Elder


Build A Flashcard Website With Python and Django

36 Lectures 2.5 hours

John Elder


Build a Weather App With Python and Django

28 Lectures 2 hours

John Elder


Build An API With The Django Rest Framework Using Python

Best Seller

20 Lectures 1 hours

John Elder


Build A Dental Website With Python and Django

Most Popular

35 Lectures 3 hours

John Elder


Build Python Django Real Project: Django Web Development

Best Seller

79 Lectures 10 hours

Rathan Kumar