» Serving static files with mod_wsgi and Django
Serving static files with mod_wsgi and Django
|April 8, 2009
Posted by forumadmin
I have a django application using mod_python, fairly typical configuration except that media files are being served by a (I know, not recommended) ‘media’ directory in the document root. I would like to test and maybe deploy with mod_wsgi but I cannot figure out how to create something simple to serve static files. mod_python allows the use of Apache directives like:
The django docs seem to point to the second block above as the correct way to make a similar exception for mod_wsgi, but in my tests everything below root is still being sent to the wsgi app. Is there a good way set a static media directory with mod_wsgi, or is what I am trying to do intentionally unsupported for compelling technical reasons? Answers that point to entirely different approaches are welcome.
More Related Questions
- Matplotlib and WSGI/mod_python not working on Apache Everything works as supposed to on the Django development server. In Apache, the django app also works except when matplotlib is used. Here's the error I get:
No module named […]
- Web content filter with Apache + mod_wsgi? I'd like to write a simple web content filter with flexible filtering rules that are written in Python. The filter is to be used as a forward proxy.
Now, I have trouble choosing the right […]
- Converting from mod_python to mod_wsgi My website is written in Python and currently runs under mod_python with Apache. Lately I've had to put in a few ugly hacks that make me think it might be worth converting the site to […]
- python webpage mod_wsgi Before I used mod_python for python websites. Unfortunately mod_python is not up to date any more so I looked for another framework and found mod_wsgi.
In mod_python it was possible to […]
- deploying a WSGI application on mod_python I wrote a WSGI application which I need to deploy to a server, however I've been given a server that already has mod_python installed.
I am not allowed to remove mod_python since there […]
- Django newbie deployment question – ImportError: Could not import settings settings The app runs fine using django internal server however when I use apache + mod_python I get the below error
File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", […]
- Django and mod_wsgi Root URL Config I'm having a very strange issue with serving a Django project using Apache and mod_wsgi. When the URL is requested it seems that mod_wsgi and Django completely ignores my ROOT_URLCONF […]
- Apache mod_wsgi: PermissionError when trying to access a page Trying to get Django running on this Apache box, using Python 3.3
httpd starts without fault but as soon as I try to access localhost, I am thrown a 500 error. The Apache logs say […]
- Restarting a Django application running on Apache + mod_python I'm running a Django app on Apache + mod_python. When I make some changes to the code, sometimes they have effect immediately, other times they don't, until I restart Apache. However I […]
- Deploying Django (fastcgi, apache mod_wsgi, uwsgi, gunicorn) Can someone explain the difference between apache mod_wsgi in daemon mode and django fastcgi in threaded mode. They both use threads for concurrency I think.
Supposing that I'm using nginx […]