I am familiarizing my self with django.
I have succesfully installed and tested a demo site. I now want to switch on the admin module, to see what happens.
This is the steps I took (granted, some were unnecessary, but I just wanted to make sure I was starting from a clean slate):
- Edited mysite/settings.py to enable admin
- Edited mysite/url.py to enable admin
- dropped and recreated my backend db
- run ./manage.py syncdb (and responded correctly to the prompts)
- started the dev web server (./manange.py runserver)
Here is what my mysite/settings.py file looks like (relevant section only)
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',
# The next lines are my models
'mysite.foo',
'mysite.foobar',
)
Here is what my mysite/urls.py file looks like:
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/', include(admin.site.urls)),
)
When I browse to the server url , I get this response:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
1. ^admin/doc/
2. ^admin/
The current URL, , didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
What am I doing wrong?