If you are using only Apache with mod_wsgi, you will also need to set up Aliases for your media directories (like css, images, or user-uploaded files). This is because mod_wsgi doesn't serve static files, it is only used to generate the dynamic pages of your site. It's perfectly possible to use Apache alone to do this without employing another web server. However, if you are implementing a site that you expect will receive high load you may want to set up a separate web server to act as a reverse proxy to your apache/mod_wsgi server while also serving static files. This will allow you to use nginx to serve static files independently of apache, for which nginx is technically more efficient although in my opinion the actual difference in negligible. I would personally stick with an apache-only configuration unless you need the flexibility afforded by two separate web server configurations.
If you're using Django 1.4 you should be using the built-in staticfiles app: https://docs.djangoproject.com/en/1.4/howto/static-files/ On Saturday, 8 September 2012 10:49:26 UTC-4, Reginald Choudari wrote: > > Hello, > > I've just started working on deploying a Django hosted website on my VPS. > Last night I finished configuring mod_wsgi with apache2.2 and had got the > 'It works!' page running from my Django project. I read here ( > https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/) the > following: > > Django doesn't serve files itself; it leaves that job to whichever Web > server you choose. > We recommend using a separate Web server -- i.e., one that's not also > running Django -- for serving media. Here are some good choices: > > - lighttpd <http://www.lighttpd.net/> > > > - Nginx <http://wiki.nginx.org/Main> > > I don't really understand this. This morning I configured my urls.py and > views.py to direct the '/' site url to an index.html template I created on > the fly (just for sanity check). Although it wasn't working at first, I > restarted apache2.2 service and the web page shows fine now. I don't > understand the idea of hosting two web servers and how Django is involved > with this if at all. > > To me, it seems like apache routes clients to the wsgi, and the wsgi > returns with whatever http response it conjures up? Can someone shed some > light on this? > > Thanks, > RC > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/9XWD6jFXeRAJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.