Here is my setup. I am using Django version 1.1.1 on Dreamhost, Python 2.4. The problem I am having is whenever I create a simple app and also have admin.autodiscover() enabled, Django will throw an exception. My setup:
from django.conf.urls.defaults import *
from testapp.views import HelloWorld
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^HelloWorld/$', HelloWorld),
# 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)),
)
My settings.py looks like:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
'testapp',
)
My testapp.views looks like:
from django.http import HttpResponse
def HelloWorld(request):
return HttpResponse("Hello world")
If I comment out admin.autodiscover() I can get to my view of HelloWorld. If I enable admin.autodiscover() Django throws an exception that I am not able to trap.
Does anyone know why this might be happening and what I can do to fix it?