I have a website that I am currently rewriting app-by-app using Django. Server is RedHat. Running Apache 2. Installed mod_wsgi. Everything works fine. Awesome.
If I go to http://www.example.com/ I get to the main site that pre-exists (in PHP).
I have mod_wsgi running and working just fine. If I go to http://www.example.com/django/ I get to my Django powered homepage.
I have several apps that work from that just fine:
- http://www.example.com/django/software: runs my Django software app just fine.
- http://www.example.com/django/newsletter: runs my Django newsletter app just fine.
All the reverse url lookups work fine - everything is great.
The global entry in Apache's httpd.conf is:
WSGIScriptAlias /django /path/to/django/mysite/mysite/apache/django.wsgi
However, as I roll this out into production, I don't want to have the /django part of the url involved.
So, a request for http://www.example.com/software would run the Django software app.
A request for http://www.example.com/newsletter would run the Django newsletter app.
I can't make http://www.example.com/ redirect to the root Django wsgi application just yet - that will probably happen in a couple months time when the whole site Django rewrite is done.
So, any ideas how I can make my Django apps work in the current setup?
Do I have to create per app wsgi files (eg: /path/to/django/mysite/mysite/apache/software.wsgi and /path/to/django/mysite/mysite/apache/newsletter.wsgi) with per app entries in the httpd.conf file? Such as:
WSGIScriptAlias /software /path/to/django/mysite/mysite/apache/software.wsgi
WSGIScriptAlias /newsletter /path/to/django/mysite/mysite/apache/newsletter.wsgi
I can't seem to find that much specific documentation on this particular style of setup. Most docs assume that you are using one main wsgi file and Django (via urls.py) to broker all requests. I would love that to the case for me, but right now that can't happen.
It might be some Apache directive kung-fu I have to wrangle. If that is the case please let me know.
TIA.