Hi,
I am serving my django project with mod_python and ran into a problem
regarding the admin interface (django.contrib.admin). If DEBUG = False
is set in settings.py the admin interface generates 404 error messages
when clicking on any of my models, for example to add a new entry. The
django shipped models work without any problems. If I set DEBUG = True
everything works fine as expected. It is odd that the models show up
in the interface but clicking them generates 404 errors.
The problem occurs with django-1.1.2 and django-1.2.1, django-1.0.*
works fine.
I tested this on debian and ubuntu with different projects. To hunt
the problem down I tested with mod_wsgi, which has the same problem.
Here is my apache configuration with mod_python:
<VirtualHost *:80>
ServerAdmin webmas...@localhost
DocumentRoot /home/jan/tmp/my_project
Options Indexes FollowSymLinks
<Location />
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/home/jan/tmp/my_project/', ] +
sys.path"
SetEnv DJANGO_SETTINGS_MODULE my_project.settings
PythonOption django.root /mynew
PythonDebug On
</Location>
<Location "/static/">
SetHandler None
</Location>
<Location "/media">
SetHandler None
</Location>
</VirtualHost>
Here is my settings.py configuration file:
DEBUG = False
TEMPLATE_DEBUG = DEBUG
[...]
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
ROOT_URLCONF = 'my_project.urls'
TEMPLATE_DIRS = (
'/home/jan/tmp/my_project/templates'
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'my_project.my_app',
)
My urls.py url configuration file looks like this:
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
)
And my model my_app/models.py looks as follows:
from django.db import models
from django.contrib import admin
class Blubb(models.Model):
x = models.IntegerField()
admin.site.register(Blubb)
Any ideas what could be wrong?
Kind regards,
Jan
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.