I thought the very same mechanism would work both for development server and Apache as my web server but I am currently really confused.
I can access a URL whilst using the Django development server as follows
__http://devserver/my_application/
When I switch my web server to Apache, I am getting Django 404 errors for all URLs.py entries.
trying to access __http://devserver/ returns the following
Using the URLconf defined in antrum.urls, Django tried these URL patterns, in this order:
^my_application/$
^my_application/?page=(?P<page>\d+)
^my_application/new
^my_application/(?P<candidate_id>\d+)/$
^my_application/(?P<candidate_id>\d+)/update/$
^my_application/(?P<candidate_id>\d+)/delete/$
^my_application/search/$
^admin/doc/
^admin/
The current URL, , didn't match any of these.
Trying to access http://devserver/my_application/ results the following output
{'path': u'my_application/'}
I am probably making a lame mistake but can not get to see that now. What might have I been missing to check?
Here’s my Apache configuration
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE project.settings
PythonOption django.root /
PythonDebug On
PythonPath "['/home/user/','/home/user/project/'] + sys.path"
</Location>
<Location "/media/">
SetHandler None
</Location>
Here are my findings:
- Switching to manage.py runserver solves my problem
- Apache Error.log has no entries
- When I set the Environment variable for pythonpath and use the python CLI, I can access my models, which also IMHO leaves the python path option off of this
- __http://devserver/my_application and __http://devserver/my_appTYPO gives the same error message with different {u’path’: …} output
Don’t set django.root variable when mounting at the root of the web site. That should only be used where mounting at a sub URL.