4 items tagged “settings”
2009
Contextual (via) I’ve been trying to figure out a sane way to replace Django’s settings.py global module with something that’s designed to be reconfigured at run-time. Contextual appears to be trying to solve exactly that problem.
Django Settings Tip—Setting Relative Paths. This is the first thing I do in every single one of my Django projects—it makes projects relocatable to other machines with just a couple of lines of code. I wouldn’t be at all upset to see it added to the default Django settings.py file created by ./manage.py startproject
2007
Using Unipath to Keep Things Portable. Django tip to avoid hard-coding full paths. I usually set a global called OUR_ROOT in settings.py using os.path.dirname(__file__) and use os.path.join with it to construct any other paths that I need.
Using django.newforms with Pylons. It’s always good to see Django components used outside of the framework itself. For the record, you can avoid the DJANGO_SETTINGS_MODULE environment variable entirely using django.conf.settings.configure (search for it).