<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jan Mészáros &#187; Django</title>
	<atom:link href="http://www.meszaros.cz/tag/django/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.meszaros.cz</link>
	<description>reflections on technology and society</description>
	<lastBuildDate>Fri, 18 Jun 2010 18:47:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Python virtual environment</title>
		<link>http://www.meszaros.cz/2009/11/python-virtual-environment/</link>
		<comments>http://www.meszaros.cz/2009/11/python-virtual-environment/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 10:42:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.meszaros.cz/?p=119</guid>
		<description><![CDATA[Hosting multiple Django projects requires to keep deployment and libraries in control. Imagine, that an one year old Django application is written for Django 0.96, but new projects are written using the actual version 1.1.1. It is possible, of course, to rewrite the old applications to be compatible with the actual version, but rewriting many [...]]]></description>
			<content:encoded><![CDATA[<p>Hosting multiple Django projects requires to keep deployment and libraries in control. Imagine, that an one year old Django application is written for Django 0.96, but new projects are written using the actual version 1.1.1. It is possible, of course, to rewrite the old applications to be compatible with the actual version, but rewriting many projects might consume a lot of time.</p>
<p>There is a smart solution to deploy applications using different versions of Django on only one production server. This can be done easily using the "<a href="http://http://pypi.python.org/pypi/virtualenv">virtualenv</a>" library, which allows you to create unlimited number of python environments including the site-packages directory.</p>
<p>At first, install the virtualenv library with easy_install:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">easy_install virtualenv</div>
</li>
</ol>
</div>
<p>Then, create a new Python virtual environment:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">virtualenv --no-site-packages <span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>lib<span class="sy0">/</span>my_new_python_environment</div>
</li>
</ol>
</div>
<p>The --no-site-packages parameter avoids access to the global site-packages dir to the virtual environment. Finally, activate the new python environment with command:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1"><span class="kw3">source</span> <span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>lib<span class="sy0">/</span>my_new_python_environment<span class="sy0">/</span>bin<span class="sy0">/</span>activate</div>
</li>
</ol>
</div>
<p>Deactivation of the activated environment is done by following command:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">deactivate</div>
</li>
</ol>
</div>
<p>Detailed how-to on deploying Django project using the new virtual environment through mod_wsgi is available at <a href="http://jmoiron.net/blog/deploying-django-mod-wsgi-virtualenv/" rel="nofollow">http://jmoiron.net/blog/deploying-django-mod-wsgi-virtualenv/</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.meszaros.cz/2009/11/python-virtual-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django REST applications and server with django-roa</title>
		<link>http://www.meszaros.cz/2009/10/django-rest-applications-and-server-with-django-roa/</link>
		<comments>http://www.meszaros.cz/2009/10/django-rest-applications-and-server-with-django-roa/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 10:22:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.meszaros.cz/?p=75</guid>
		<description><![CDATA[If you are looking for ready-to-use Django REST server and clients solution, I recommend you the David Larlet's django-roa library. I have been using this library in testing environment from July 2009 with good testing results. The django-roa project is continuously improved, as can be seen on the project changelog.]]></description>
			<content:encoded><![CDATA[<p>If you are looking for ready-to-use Django REST server and clients solution, I recommend you the David Larlet's <a href="http://code.welldev.org/django-roa/wiki/Home"> django-roa</a> library. I have been using this library in testing environment from July 2009 with good testing results. The django-roa project is continuously improved, as can be seen on the <a href="http://code.welldev.org/django-roa/changesets/">project changelog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.meszaros.cz/2009/10/django-rest-applications-and-server-with-django-roa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIM tab configuration for Django HTML templates</title>
		<link>http://www.meszaros.cz/2009/10/vim-configuration-for-django-html-templates/</link>
		<comments>http://www.meszaros.cz/2009/10/vim-configuration-for-django-html-templates/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 16:08:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://www.meszaros.cz/?p=59</guid>
		<description><![CDATA[This tiny trick allows you to set tabs (and anything else of course) for Django template filetype. VIM has build-in filetype named "htmldjango", which does all the magic shown in the example configuration below. An example .vimrc configuration file uses the "autocmd" VIM command, whis must be available in your installation. if has(&#34;autocmd&#34;) &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>This tiny trick allows you to set tabs (and anything else of course) for Django template filetype. VIM has build-in filetype named "htmldjango", which does all the magic shown in the example configuration below.</p>
<p>An example .vimrc configuration file uses the "autocmd" VIM command, whis must be available in your installation.</p>
<div class="geshi no text">
<ol>
<li class="li1">
<div class="de1">if has(&quot;autocmd&quot;)</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; autocmd FileType htmldjango set tabstop=4|set shiftwidth=4|set expandtab</div>
</li>
<li class="li1">
<div class="de1">endif</div>
</li>
</ol>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.meszaros.cz/2009/10/vim-configuration-for-django-html-templates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Django multiple database support with DB switch feature</title>
		<link>http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/</link>
		<comments>http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 17:36:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.meszaros.cz/?p=51</guid>
		<description><![CDATA[Our Django installation is capable to connect to as many databases as desired and switch between databases in according to session data. We reached this feature overriding several internal Django classes, according to recommendations on http://groups.google.com/group/django-users/msg/d1d7e0af565cc444?. All multiple database features are done without changes in original Django code. Partial how-to can be found on http://kfalck.net/2009/07/01/multiple-databases-and-sharding-with-django [...]]]></description>
			<content:encoded><![CDATA[<p>Our Django installation is capable to connect to as many databases as desired and switch between databases in according to session data. We reached this feature overriding several internal Django classes, according to recommendations on <a href="http://groups.google.com/group/django-users/msg/d1d7e0af565cc444?." rel="nofollow">http://groups.google.com/group/django-users/msg/d1d7e0af565cc444?.</a> All multiple database features are done without changes in original Django code.</p>
<p>Partial how-to can be found on <a href="http://kfalck.net/2009/07/01/multiple-databases-and-sharding-with-django" rel="nofollow">http://kfalck.net/2009/07/01/multiple-databases-and-sharding-with-django</a> too.</p>
<p>The solution is successfully tested for more than one month in real-world application and this application is going to be used into production environment soon.</p>
<p>For implementation details or questions leave a comment below.</p>]]></content:encoded>
			<wfw:commentRss>http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
