I have a django application set up using mainly the admin interface with a few of my own views. Everything is working corrctly on the devlopment server on my local machine.
However on the production server, using Apache, and mod_wsgi, it is messing up the URLs when I issue a redirect statement in one of my views. Instead of going to
www.hostname.com/wsgi/django/admin/myapp/myform.html
it goes to
www.hostname.com/admin/myapp/myform.html
Apache doesn’t recognise anything under an admin folder, so I get an error.
So in my apache configuration I have the following, so that anything under wsgi/django gets sent to my app:
WSGIScriptAlias /wsgi/django /project/production/public/wsgi/django_eclipse/myapp.wsgi
In my problematic view I have the following:
return redirect('/admin/sequencing/load_flowcell?' + params )
I can make this work, if I change the redirect to include the ‘/wsgi/django’ part, but this means I can’t keep the one on my development server the same. Is there a way in Django settings, or http.conf to set this so that my redirect automatically includes this part of the URL?
EDIT: REAL FIX
CAVEAT:
https://docs.djangoproject.com/en/dev/howto/deployment/modpython/#basic-configuration