On Dec 13, 6:43 pm, benw <benwil...@gmail.com> wrote:
> I have the exact same problem with Django 1.0.2 Final on Debian Etch
> (Apache 2.2.3-4+etch6 / mod_python 3.2.10-4) -- My settings.py, vhost
> and urls.py are nearly exactly the same as above (the relelant parts
> anyway.)
>
> On Dec 12, 3:00 am, Bluemilkshake <bluemilksh...@googlemail.com>
> wrote:
>
> > Of course.
> > urls.py below:
>
> > Underneath that is the relevant <Location> directives from my
> > vhosts.conf file.
>
> > Many thanks,
> > -M
>
> > --- urls.py ---
> > from django.conf.urls.defaults import *
>
> > # Uncomment the next two lines to enable the admin:
> > from django.contrib import admin
> > admin.autodiscover()
>
> > urlpatterns = patterns('',
> >     # Example:
> >     # (r'^djangotest/', include('djangotest.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/(.*)', admin.site.root),
> > )
> > --- end of file ---
>
> > --- Segment from vhosts.conf ---
> > <VirtualHost xxx.xxx.xxx.xx:80>
> >         <Location />
> >                 # Options +Includes
> >                 SetHandler python-program
> >                 PythonHandler django.core.handlers.modpython
> >                 SetEnv DJANGO_SETTINGS_MODULE djangotest.settings
> >                 SetEnv PYTHON_EGG_CACHE /var/tmp/egg
> >                 PythonOption django.root /
> >                 PythonDebug On
> >                 PythonPath "['<path_to_my_project>'] + sys.path"
> >         </Location>
> > </VirtualHost>
> > --- end of file segment ---

I've been thinking about this and I think the problem is in the vhosts
file - specifically, the PythonOption django.root line. This is really
only for when you're running a site under a sub-path, and what happens
is that everything you specify there is removed before passing it to
Django. Since you're serving your site at the root, and you've just
put / in that option, it removes the slash - which explains why you
have the puzzling
Request URL: http://djangotest.bluemilkshake.co.ukadmin
in your original traceback, with no slash between the domain and the
admin directory.

So, my advice: remove that line altogether, restart Apache and see if
that works. If it does, I'll work up a documentation patch to explain
that you shouldn't use a django.root option if you're just serving
from the root.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to