I have my urls named like so in my root urls.py file...
...
url(r'^login/$', 'login', name='site_login'),
...
This allows me to access /login at my site's root. I have my template
tag defined like so...
...
<a href="{% url site_login %}">
...
It works fine, except that Django automatically resolves that url as /
myprojectname/login, not /login. Both urls are accessible. Only one is
defined. Why is the projectname being inserted to the url
automagically? This occurs for all url tags, not just this one.
Thanks,
Adam
If all URLs work both with and without a prefix, it would seem that
you've somehow duplicated your URL definitions somewhere. Could you
post your entire urls.py? Preferably somewhere like dpaste.com.
--
DR.
If all URLs work both with and without a prefix, it would seem that
you've somehow duplicated your URL definitions somewhere. Could you
post your entire urls.py? Preferably somewhere like dpaste.com.
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#basic-configuration
I changed <Location "/mysite"> to <Location "/"> so my Django project
would be served at my site's root directory.
I had to remove '/mysite' from the django.root option. My final output
looks like this, with no value after django.root:"
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root
PythonDebug On
</Location>
For the record, I am running:
Django 1.0
Apache 2.2
mod_python 3.3.1 (i think... :))
Ubuntu Hardy 8.04.4
Hey folks, thanks for the responses. Your questions alone helped me
find the answer. Apparently, it was a problem with my apache2
configuration. I basically copied the directives from the django
website, with one small modification:
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#basic-configuration
I changed <Location "/mysite"> to <Location "/"> so my Django project
would be served at my site's root directory.
I had to remove '/mysite' from the django.root option. My final output
looks like this, with no value after django.root:"