For marketers
who love technology
Home » , , » A Django tutorial on Debian - part 4: creating the web administration portal

A Django tutorial on Debian - part 4: creating the web administration portal

Django logo
Django logo (Photo credit: Wikipedia)
.Django creates automatically a web admin portal for our web app. We just have to edit the file and to uncomment "django.contrib.admin" in the INSTALLED_APPS setting.

    # Uncomment the next line to enable the admin:
    # Uncomment the next line to enable admin documentation:
We need to update the database to take into account the new apps. But first, we will check if we have the latest version of Django.

sudo easy_install --upgrade django
chmod +x
./ syncdb

If we have a look to our django powered website, we will see that it is still empty, because we have not defined any url for the moment:

./ runserver

Let's define the URLs by editing the file and uncommenting all lines related to the admin and admin documentation:

# Uncomment the next two lines to enable the admin:
from django.contrib import admin


    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(,

Now, our admin site is ready:


If you do not remember the admin password that you setup in part 2 of this tutorial (the login is root), then create a new one.

The admin portal does not display our application textModif. We have to go to textModif folder and add a file there:

cd textModif

We put the following lines in this file:

from django.contrib import admin
from textModif.models import *

We restart the server to see the changes (kill the associated process if you have maintained the server):

./ runserver

Now we can edit our data structure through the web administration interface. Django's official tutorial shows also how to customize very easily the admin interface. We will skip this part, as I would like to focus on our web app's frontend implementation.


About Gilles


Post a Comment