I'm building a django site, but I have a lot of static files from my old server served at the root directory that I want to still work.
For example these links should still work, even though there is now a django site at the top level as well.
I have all the old static files stored under /home/username/webapps/static/.
I want it so that the static file is served if it exists, if not send the url to django to process.
How can I achieve this?
In this case what you should do is create the URLs in your Django app's urls.py file then doing something like a direct_to_template:
to still serve the files/pages you had there.
answered Jan 21 '11 at 18:42
Ok, got it working with mod_rewrite. I added the following to my httpd.conf, before the django WSGIScriptAlias. This checks if the request matches a filename or directory in the static directory, else sends the request on to django.