Django: Setting up sub-domain to serve static files

Apache, Django

In my last post, I discussed how to set up Django with Apache and mod_wsgi. In this post, I will discuss how to set up a sub-domain to serve static files (css, js, images, etc). The Django documentation states that using a sub-domain for static files is recommended.

Note: Although I set up my Django installation on Ubuntu, most of these instructions are common to most OS’s.

Continue reading

Checkout My New Site - T-shirts For Geeks

Setting up Django with Apache and mod_wsgi on Ubuntu 11.10

Apache, Django, Ubuntu

I beginning a new project where I decided to use Django. I briefly worked with Django for an embedded device over two years ago. Now I am creating a full-fledged web application using Django and jQuery.

When setting up Django, I initially followed the tutorials on djangobook.com. While the site is a good starting point for learning Django, it lacks some details, especially as it relates to serving static files (css, js, etc.) while using the development server. After struggling with the display of my css files, I decided to use Apache instead of the development server. After all, the development server will not be used in production, so I would rather duplicate a production environment as much as possible. In my opinion, the primary reason for using the development server is for debugging, but so far, I have found that Apache’s error log has been pretty good.

Continue reading

Checkout My New Site - T-shirts For Geeks