Saturday, June 5, 2010

Single settings file for Django deployment on Webfaction

After only a few days of this blog being up, I already became annoyed with having to maintain separate settings files for development and production. Thankfully, fixing this problem was incredibly quick and easy and should save me some headaches in the future. All I did was determine what host the settings file resides on and then set the parts of the settings file that change between development and production. Here is what the relevant part of my Django settings file looks like:

That's it!