djangoapachedjango-flatpages

Django Apache2 mod_wsgi flatpages admin not working


I finally got apache2 with mod_wsgi working on Linux (havent much luck with windows :D) and everything works fine, but now when I added flatpages to my project, I found out that Apache doesn't seem to be aware of URL for admin when trying to create new flatpage via admin.

It says

Page not found (404)
Request Method:     GET
Request URL:    http://127.0.0.1/admin/flatpages/flatpage/1/

And now I noticed that when I'm on admin front page, and hit F5 again and again, flatpages admin appears and disappears, but nothing like this happens when using dev server, so I'll try to create new project with default setting and see what it'll do in apache and in dev server, did anyone came across this kind of error?


Solution

  • The Django dev server auto-reloads your code when you change it, but Apache does not.

    If you are running mod wsgi in daemon mode, you can reload the code by touching the wsgi script.

    touch myproject/mysite.wsgi
    

    Otherwise, you may have to restart apache. For example

    /etc/init.d/apache2 restart