<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Django configuration file</title>
	<atom:link href="http://blog.motane.lu/2009/12/28/django-configuration-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.motane.lu/2009/12/28/django-configuration-file/</link>
	<description>skillz...i has them</description>
	<lastBuildDate>Thu, 09 Sep 2010 16:17:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tudor</title>
		<link>http://blog.motane.lu/2009/12/28/django-configuration-file/comment-page-1/#comment-1135</link>
		<dc:creator>Tudor</dc:creator>
		<pubDate>Sat, 06 Feb 2010 20:25:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=1245#comment-1135</guid>
		<description>Nice one. But you&#039;re right, in the end, it matters more what works for you.</description>
		<content:encoded><![CDATA[<p>Nice one. But you&#8217;re right, in the end, it matters more what works for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrei</title>
		<link>http://blog.motane.lu/2009/12/28/django-configuration-file/comment-page-1/#comment-1127</link>
		<dc:creator>andrei</dc:creator>
		<pubDate>Fri, 05 Feb 2010 12:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=1245#comment-1127</guid>
		<description>Hi, 
settings.py doesn&#039;t have to be file. Django is a python application and settings is a module. You can create a settings directory with a __init__.py file in it. There you could separate the configurations in multiple files. In general I use the following files:
 * environment - specific to deployed server
 * django_app - specific to django (like MIDDLEWARE_CLASSES... )
 * logger - hooks up the logging system from python
 * application_name - application specific settings

Don&#039;t forget to add from  import * in the __init__ file. 

I have in a configs directory the configurations for different environments. The deployment script knows what to copy to each server. 
You can apply this approach with directories for modules to views.py, urls.py or models.py files. 
I don&#039;t say that this method is the best but it works for me.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
settings.py doesn&#8217;t have to be file. Django is a python application and settings is a module. You can create a settings directory with a __init__.py file in it. There you could separate the configurations in multiple files. In general I use the following files:<br />
 * environment &#8211; specific to deployed server<br />
 * django_app &#8211; specific to django (like MIDDLEWARE_CLASSES&#8230; )<br />
 * logger &#8211; hooks up the logging system from python<br />
 * application_name &#8211; application specific settings</p>
<p>Don&#8217;t forget to add from  import * in the __init__ file. </p>
<p>I have in a configs directory the configurations for different environments. The deployment script knows what to copy to each server.<br />
You can apply this approach with directories for modules to views.py, urls.py or models.py files.<br />
I don&#8217;t say that this method is the best but it works for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tudor</title>
		<link>http://blog.motane.lu/2009/12/28/django-configuration-file/comment-page-1/#comment-1032</link>
		<dc:creator>Tudor</dc:creator>
		<pubDate>Tue, 05 Jan 2010 14:53:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=1245#comment-1032</guid>
		<description>Yep, that&#039;s also a good idea, but I - personally - don&#039;t agree with overriding constants as it decreases code readability. Defining the same &quot;constant&quot; in different places throughout the application can become  confusing. 

PS: you can always use &lt;pre lang=&quot;python&quot;&gt; &lt;/pre&gt; for your code.</description>
		<content:encoded><![CDATA[<p>Yep, that&#8217;s also a good idea, but I &#8211; personally &#8211; don&#8217;t agree with overriding constants as it decreases code readability. Defining the same &#8220;constant&#8221; in different places throughout the application can become  confusing. </p>
<p>PS: you can always use &lt;pre lang=&#8221;python&#8221;&gt; &lt;/pre&gt; for your code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Igor Sobreira</title>
		<link>http://blog.motane.lu/2009/12/28/django-configuration-file/comment-page-1/#comment-1029</link>
		<dc:creator>Igor Sobreira</dc:creator>
		<pubDate>Mon, 04 Jan 2010 22:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.motane.lu/?p=1245#comment-1029</guid>
		<description>Hi,

I do almost the same thing, creating a local settings file that is not under version control, but I prefer not to import it, but to &quot;append&quot; it, with something like this in the end of settings.py:

&lt;pre lang=&quot;python&quot;&gt;
try:
    execfile(os.path.join(ROOT_DIR, &#039;local.py&#039;), globals(), locals())
except IOError:
    pass
&lt;/pre&gt;

This way, inside local.py I can use all the settings constants defined in settings.py, and override any too.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I do almost the same thing, creating a local settings file that is not under version control, but I prefer not to import it, but to &#8220;append&#8221; it, with something like this in the end of settings.py:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">try</span>:
    <span style="color: #008000;">execfile</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>ROOT_DIR, <span style="color: #483d8b;">'local.py'</span><span style="color: black;">&#41;</span>, <span style="color: #008000;">globals</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>, <span style="color: #008000;">locals</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">IOError</span>:
    <span style="color: #ff7700;font-weight:bold;">pass</span></pre></div></div>

<p>This way, inside local.py I can use all the settings constants defined in settings.py, and override any too.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
