I've been trying to make a simple app in Django for a while now and I noticed the following behaviours:

  1. Everytime I make changes to urls.py in my project folder, changes are not reflected until I restart http daemon. Why? Is there any way I can do without this?

  2. I tried to redirecting r'^staff/$' to staff.views.index (staff is my app name). But accessing /staff gave me a "Server Error", which on inspection of error_log showed "TemplateSyntaxError: Caught ImportError while rendering: No module named staff". What does this mean?

On removing that particular line from urls.py (and restarting httpd), accessing / reverted back to "It works" page. But, when I refresh the page after clearing all browsing data (including cache), I magically get back the page saying

Using the URLconf defined in myproj.urls, Django tried these URL patterns, in this order:
The current URL, , didn't match any of these.

This really puzzles me; how could it have possibly come back? I've tried to understand what's going on, but sadly, I've failed. At this rate, I might just go back to cakephp. I don't want to go back, help!

Background Information:

I run Apache with mod_wsgi on Arch Linux. myproj is my project name (located at /srv/http-django) and it has one app called staff (added to INSTALLED_APPS). My WSGI script adds /srv/http-django to sys.path and sets DJANGO_SETTINGS_MODULE to myproj.settings.

myproj/staff/views.py contains index function which simply returns "Hello, World!" as HttpResponse


For your first problem read:


For the second problem, you could have a sys.path problem or more likely an import order dependency or problem due to naming of modules. If you are lucky using the alternate WSGI script file described in:


may help, but then it may not.


If you run mod_wsgi in Daemon mode you can update changes by touching the .wsgi file. (I've found this to be a bit flaky though)

  • There are no known issues with mod_wsgi daemon reloading mechanism. If you believe there is a problem have your reported it? – Graham Dumpleton Jun 20 '11 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.