<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: settings</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/settings.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2009-05-12T13:19:25+00:00</updated><author><name>Simon Willison</name></author><entry><title>Contextual</title><link href="https://simonwillison.net/2009/May/12/contextual/#atom-tag" rel="alternate"/><published>2009-05-12T13:19:25+00:00</published><updated>2009-05-12T13:19:25+00:00</updated><id>https://simonwillison.net/2009/May/12/contextual/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://pypi.python.org/pypi/Contextual"&gt;Contextual&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
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.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="http://groups.google.com/group/paste-users/browse_thread/thread/7346e75940413f46"&gt;A discussion on Paste Users&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/contextual"&gt;contextual&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/globals"&gt;globals&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/settings"&gt;settings&lt;/a&gt;&lt;/p&gt;



</summary><category term="contextual"/><category term="django"/><category term="globals"/><category term="python"/><category term="settings"/></entry><entry><title>Django Settings Tip - Setting Relative Paths</title><link href="https://simonwillison.net/2009/Feb/12/relocatable/#atom-tag" rel="alternate"/><published>2009-02-12T12:30:00+00:00</published><updated>2009-02-12T12:30:00+00:00</updated><id>https://simonwillison.net/2009/Feb/12/relocatable/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://morethanseven.net/2009/02/11/django-settings-tip-setting-relative-paths/"&gt;Django Settings Tip - Setting Relative Paths&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
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


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gareth-rushgrove"&gt;gareth-rushgrove&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/settings"&gt;settings&lt;/a&gt;&lt;/p&gt;



</summary><category term="django"/><category term="gareth-rushgrove"/><category term="python"/><category term="settings"/></entry><entry><title>Using Unipath to Keep Things Portable</title><link href="https://simonwillison.net/2007/Dec/21/empty/#atom-tag" rel="alternate"/><published>2007-12-21T10:45:53+00:00</published><updated>2007-12-21T10:45:53+00:00</updated><id>https://simonwillison.net/2007/Dec/21/empty/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.michaeltrier.com/2007/12/21/using-unipath-to-keep-thing-portable"&gt;Using Unipath to Keep Things Portable&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
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.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/michael-trier"&gt;michael-trier&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/settings"&gt;settings&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/unipath"&gt;unipath&lt;/a&gt;&lt;/p&gt;



</summary><category term="django"/><category term="michael-trier"/><category term="python"/><category term="settings"/><category term="unipath"/></entry><entry><title>Using django.newforms with Pylons</title><link href="https://simonwillison.net/2007/Nov/27/max/#atom-tag" rel="alternate"/><published>2007-11-27T15:01:50+00:00</published><updated>2007-11-27T15:01:50+00:00</updated><id>https://simonwillison.net/2007/Nov/27/max/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://maxischenko.in.ua/blog/entries/130/using-djangonewforms-with-pylons/"&gt;Using django.newforms with Pylons&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
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).


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/newforms"&gt;newforms&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pylons"&gt;pylons&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/settings"&gt;settings&lt;/a&gt;&lt;/p&gt;



</summary><category term="django"/><category term="newforms"/><category term="pylons"/><category term="python"/><category term="settings"/></entry></feed>