<?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>Rob Golding &#187; django</title>
	<atom:link href="http://www.robgolding.com/blog/category/django/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robgolding.com</link>
	<description>Technology Consultant</description>
	<lastBuildDate>Mon, 07 Jun 2010 22:04:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Backtrac Implementation &#8211; The Major Decisions</title>
		<link>http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/</link>
		<comments>http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 09:09:50 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[amqp]]></category>
		<category><![CDATA[backtrac]]></category>
		<category><![CDATA[piston]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=393</guid>
		<description><![CDATA[Thinking a lot about my 3rd year project, I've been considering how to implement a backup system based around a Django server. So far, I have reached the conclusion that the system will consist of three main parts: The Django server (yet to be named) The client daemon (backtracd) The backup library itself (backuplib) As [...]]]></description>
			<content:encoded><![CDATA[<p>Thinking a lot about my <a title="3rd Year Project: Back to Backtrac" href="http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/">3rd year project</a>, I've been considering how to implement a backup system based around a Django server. So far, I have reached the conclusion that the system will consist of three main parts:</p>
<ul>
<li>The Django server (yet to be named)</li>
<li>The client daemon (<em>backtracd</em>)</li>
<li>The backup library itself (<em>backuplib</em>)</li>
</ul>
<p><span id="more-393"></span>As I mentioned in the previous post, the Django server will be based around <a title="Celery Project" href="http://celeryproject.org/" target="_blank">Celery</a>. This will offer me the ability to schedule a task for a certain date and time in the future, which is a huge part of the implementation taken care of.</p>
<p>One thing I am yet to figure out, however, is how the server will communicate with the client daemons. At the moment I'm thinking <a title="XML-RPC" href="http://www.xmlrpc.com/" target="_blank">XML-RPC</a>, but it seems to me that it will end up a sort of mish-mash of different technologies - as the Django server will be exposing a JSON API (probably via <a title="django-piston" href="http://bitbucket.org/jespern/django-piston/" target="_blank">Piston</a>). I have also considered running Django on the clients too, so everything can use JSON/Piston, but this seems at the moment like an unnecessary burden.</p>
<p>Another thing to consider is the <em>data</em> that is to be transmitted between the nodes. Should I use a bunch of fields in a JSON object to represent the success/failure of a job, and how much data was backed up, etc.? Another option is to pickle a Result object of some sort - representing a result as a Python instance to be interpreted by the server. These are the things I love to think about when designing a system, and I'll certainly have plenty to write about in the inevitable report.</p>
<p>Something I <em>can</em> work on in the meantime, however, is <strong><a title="backuplib" href="http://github.com/robgolding63/backuplib" target="_blank">backuplib</a></strong> - the client library that will actually copy the data. At the moment, it's just a wrapper around rsync/tar. That probably won't change, but it will need to get a bit smarter in the way it handles failures (and restores, of course) if it's going to make for the basis a decent backup system.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/&amp;title=Backtrac+Implementation+-+The+Major+Decisions" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/&amp;title=Backtrac+Implementation+-+The+Major+Decisions" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/&amp;title=Backtrac+Implementation+-+The+Major+Decisions" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/&amp;title=Backtrac+Implementation+-+The+Major+Decisions" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/&amp;t=Backtrac+Implementation+-+The+Major+Decisions" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Backtrac+Implementation+-+The+Major+Decisions+-+http://tinyurl.com/3xlchle+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/&amp;n=Backtrac+Implementation+-+The+Major+Decisions&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=393&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2010/06/03/backtrac-implementation-the-major-decisions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3rd Year Project: Back to Backtrac</title>
		<link>http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/</link>
		<comments>http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/#comments</comments>
		<pubDate>Tue, 25 May 2010 09:49:00 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[backtrac]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=381</guid>
		<description><![CDATA[After contacting the university regarding my 3rd year project/dissertation, my ideal choice has been confirmed. I'll be making a distributed backup system, based around a Django web interface and AMQP. Backtrac is a pretty old project, and one whose name I am likely to change once I'm working on it. It was started in my [...]]]></description>
			<content:encoded><![CDATA[<p>After contacting the university regarding my 3rd year project/dissertation, my ideal choice has been confirmed. I'll be making a distributed backup system, based around a <a title="Django Project" href="http://djangoproject.com" target="_blank">Django</a> web interface and <a title="Advanced Message Queueing Protocol" href="http://www.amqp.org/confluence/display/AMQP/About+AMQP" target="_blank">AMQP</a>.</p>
<p><span id="more-381"></span>Backtrac is a pretty old project, and one whose name I am likely to change once I'm working on it. It was started in my first semester of university last year, when I didn't have enough work to keep me busy. I didn't know enough about Django back then, though, so it was left unfinished and only half-working.</p>
<p>Now I think I know enough to pull this off, and it's a chance to do something I really enjoy - while getting marks for it in the process! If everything goes to plan I'll be supervised by <a title="Dr. Julie Greensmith" href="http://www.cs.nott.ac.uk/~jqg/" target="_blank">Dr. Julie Greensmith</a>, which I'm really looking forward to.</p>
<p>I'll be using an app called <a title="Celery Distributed Task Queue" href="http://celeryproject.org/" target="_blank">Celery</a> to handle the background tasks, which will be simple "pings" to the client machines, telling them to start a backup. Celery uses AMQP, provided by a broker such as <a title="RabbitMQ Enterprise Messaging System" href="http://www.rabbitmq.com/" target="_blank">RabbitMQ</a> (which is written in Erlang). It's usually used for processing intensive computational tasks, but can also be put to use for jobs that need executing on a periodic basis, like backups.</p>
<p>I can tell you're getting too excited, so I'll stop. Rest assured, though, I will be writing about the discoveries I make along the way to finishing this ambitious project.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/&amp;title=3rd+Year+Project%3A+Back+to+Backtrac" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/&amp;title=3rd+Year+Project%3A+Back+to+Backtrac" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/&amp;title=3rd+Year+Project%3A+Back+to+Backtrac" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/&amp;title=3rd+Year+Project%3A+Back+to+Backtrac" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/&amp;t=3rd+Year+Project%3A+Back+to+Backtrac" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=3rd+Year+Project%3A+Back+to+Backtrac+-+http://tinyurl.com/2w63be4+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/&amp;n=3rd+Year+Project%3A+Back+to+Backtrac&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=381&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2010/05/25/3rd-year-project-back-to-backtrac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Django Staging Server: Apache Configuration</title>
		<link>http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/</link>
		<comments>http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/#comments</comments>
		<pubDate>Fri, 07 May 2010 20:10:44 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[wsgi]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=331</guid>
		<description><![CDATA[In this post, I'd like to talk a little about how my staging server (called Kaylee, after the character from Firefly), is configured to run the multiple Django projects that I have on the go. A lot of the other articles I have read on this subject use mod_python but my server is configured to [...]]]></description>
			<content:encoded><![CDATA[<p>In this post, I'd like to talk a little about how my staging server (called Kaylee, after the <a title="Kaylee" href="http://en.wikipedia.org/wiki/List_of_Firefly_characters#Kaylee_Frye" target="_blank">character</a> from <a title="Firefly" href="http://en.wikipedia.org/wiki/Firefly_(TV_series)" target="_blank">Firefly</a>), is configured to run the multiple <a title="Django Project" href="http://www.djangoproject.com/" target="_blank">Django</a> projects that I have on the go. A lot of the other articles I have read on this subject use <code>mod_python</code> but my server is configured to use <a title="WSGI" href="http://wsgi.org/wsgi/" target="_blank">WSGI</a>, so that's what I will be going over in this post.</p>
<p><span id="more-331"></span></p>
<h3>Beginnings</h3>
<p>Firstly, I use <a title="virtualenv" href="http://virtualenv.openplans.org" target="_blank">virtualenv</a> to keep the Python environments for the different projects separate, but that's a topic in itself. This isn't a requirement, but it helps if you have dependencies that you don't want installed system-wide, or projects that use different versions of a particular package.</p>
<p>You can read more about virtualenv and Django <a title="Notes on using pip and virtualenv with Django" href="http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/" target="_blank">here</a>.</p>
<p>The directory structure for my <code>webapps</code> directory (which lives inside <code>/home/</code>) looks something like this:</p>
<pre>webapps/
|-- apache
|   |-- coral.conf
|   |-- coral.wsgi
|   |-- myuni.conf
|   `-- myuni.wsgi
|-- coral
|   |-- env
|   `-- repository
|-- myuni
|   |-- env
|   `-- repository</pre>
<p>The two projects shown here are <a title="Coral Issue Tracker" href="http://bitbucket.org/robgolding63/coral" target="_blank">Coral Issue Tracker</a> and <a title="MyUni" href="http://bitbucket.org/robgolding63/myuni" target="_blank">MyUni</a>. The directory for each project contains the virtual env for that project, and the repository. Alongside the project folders is a directory called <code>apache</code>, which holds two files for each project: the WSGI file (<code>&lt;project-name&gt;.wsgi</code>) and the Apache configuration file (<code>&lt;project-name&gt;.conf</code>).</p>
<h3>Apache Configuration</h3>
<p>Then, in the main Apache configuration, I use a directive that includes all these files automatically:</p>
<pre class="apache"><span style="color: #00007f;">Include</span>    /home/webapps/apache/*.conf</pre>
<p>The individual project configuration files then contain a set of simple directives almost straight from the Django <a title="Using Django with Apache and mod_wsgi" href="http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/" target="_blank">deployment documentation</a>. For example, the MyUni configuration looks like this:</p>
<pre class="apache">WSGIScriptAlias  /myuni        /home/webapps/apache/myuni.wsgi
<span style="color: #00007f;">Alias</span>            /myuni/docs   /home/webapps/myuni/repository/docs/_build/html
<span style="color: #00007f;">Alias</span>            /myuni/media  /home/webapps/myuni/repository/myuni/static</pre>
<h3>WSGI Files</h3>
<p>The WSGI files are also pretty simple, though there are a couple of things worth explaining. Here is the WSGI file for the MyUni project:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">site</span>
&nbsp;
<span style="color: #dc143c;">os</span>.<span style="color: black;">environ</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PYTHON_EGG_CACHE'</span><span style="color: black;">&#93;</span> = <span style="color: #483d8b;">'/tmp/myuni/egg_cache'</span>
&nbsp;
root_dir = <span style="color: #483d8b;">'/home/webapps/myuni/env'</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># with mod_wsgi &amp;gt;= 2.4, this line will add this path in front of the python path</span>
<span style="color: #dc143c;">site</span>.<span style="color: black;">addsitedir</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;">'lib/python2.6/site-packages'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/home/webapps/myuni/repository'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #dc143c;">os</span>.<span style="color: black;">environ</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'DJANGO_SETTINGS_MODULE'</span><span style="color: black;">&#93;</span> = <span style="color: #483d8b;">'myuni.settings'</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> django.<span style="color: black;">core</span>.<span style="color: black;">handlers</span>.<span style="color: black;">wsgi</span>
&nbsp;
application = django.<span style="color: black;">core</span>.<span style="color: black;">handlers</span>.<span style="color: black;">wsgi</span>.<span style="color: black;">WSGIHandler</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre>
<p>The <code>site.addsitedir()</code> call in the WSGI file adds the library path in the virtual environment to the python path, by inspecting it to find all the packages that are installed. I then append the path to the project's repository to the path also, as is standard practice in this type of deployment.</p>
<p>The only other thing worth mentioning here, is the <code>PYTHON_EGG_CACHE</code> variable that I add to the environment. This is required if you are using Python modules that are packaged up as eggs, so that Apache can uncompress them in a directory to which it can write (<code>/tmp/</code> on Ubuntu is 777 by default). If you are not using eggs, you can skip this line out altogether. Alternatively, you can uncompress the eggs first:</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">unzip</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>package<span style="color: #7a0874; font-weight: bold;">&#93;</span>.egg</pre>
<p>You can read more about this issue, and the workaround, <a title="Django: PYTHON_EGG_CACHE, access denied error" href="http://stackoverflow.com/questions/1855219/django-python-egg-cache-access-denied-error" target="_blank">here</a>.</p>
<h3>Summary</h3>
<p>That's pretty much all there is to it. This setup also makes it pretty easy to deploy new versions of my projects, for which I have started using <a title="Fabric v0.9" href="http://docs.fabfile.org/0.9.0/" target="_blank">Fabric</a>. I'll save that for another post though.</p>
<p>If you do things differently, then I'd love to hear about how - so please leave a comment!</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/&amp;title=Django+Staging+Server%3A+Apache+Configuration" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/&amp;title=Django+Staging+Server%3A+Apache+Configuration" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/&amp;title=Django+Staging+Server%3A+Apache+Configuration" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/&amp;title=Django+Staging+Server%3A+Apache+Configuration" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/&amp;t=Django+Staging+Server%3A+Apache+Configuration" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Django+Staging+Server%3A+Apache+Configuration+-+http://tinyurl.com/2wcoueu+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/&amp;n=Django+Staging+Server%3A+Apache+Configuration&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=331&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2010/05/07/django-staging-server-apache-configuration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Extending Settings Variables with local_settings.py in Django</title>
		<link>http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/</link>
		<comments>http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/#comments</comments>
		<pubDate>Mon, 03 May 2010 14:33:33 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=317</guid>
		<description><![CDATA[I discovered this hacky way to use the local_settings trick to extend and/or override values in the main Django settings file today. Some projects use a "reverse" version of the local_settings trick (which is explained below), whereby the main settings file becomes settings_local.py or something similar, which first imports settings.py, and then extends or overrides [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered this hacky way to use the local_settings trick to extend and/or override values in the main Django settings file today. Some projects use a "reverse" version of the local_settings trick (which is explained below), whereby the <strong>main</strong> settings file becomes <em>settings_local.py</em> or something similar, which first imports <em>settings.py</em>, and then extends or overrides the values as required.<span id="more-317"></span></p>
<p>I didn't want to change the name of the project settings file to <em>settings_local</em>, however, as it would mean changing the WSGI file on every server that the project runs on.</p>
<h3>The local_settings Trick</h3>
<p>It's a well-known trick to use a file called <em>local_settings.py</em> or something similar, with a piece of code at the bottom of the main settings file:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">try</span>:
    <span style="color: #ff7700;font-weight:bold;">from</span> local_settings <span style="color: #ff7700;font-weight:bold;">import</span> *
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">pass</span></pre>
<p>to override the value of settings variables. This will not work, however, if you wish to <em>extend</em> a settings variable (for example, adding an app to INSTALLED_APPS). For this, I have found that the following ugly hack seems to do the job.</p>
<h3>The Ugly Hack</h3>
<p>Replace the snippet at the bottom of the main settings file with the following code</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">try</span>:
    LOCAL_SETTINGS
<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">NameError</span>:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        <span style="color: #ff7700;font-weight:bold;">from</span> local_settings <span style="color: #ff7700;font-weight:bold;">import</span> *
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">ImportError</span>:
        <span style="color: #ff7700;font-weight:bold;">pass</span></pre>
<p>What this is doing is effectively checking for the presence of a variable called LOCAL_SETTINGS. The local_settings file then contains this code:</p>
<pre class="python">LOCAL_SETTINGS = <span style="color: #008000;">True</span>
<span style="color: #ff7700;font-weight:bold;">from</span> settings <span style="color: #ff7700;font-weight:bold;">import</span> *</pre>
<p>This means that the local_settings file will only be imported once, and it has all the variables in the main settings file available to extend at will. For example, to enable the Django debug toolbar:</p>
<pre class="python">MIDDLEWARE_CLASSES += <span style="color: black;">&#40;</span><span style="color: #483d8b;">'debug_toolbar.middleware.DebugToolbarMiddleware'</span>,<span style="color: black;">&#41;</span>
INTERNAL_IPS = <span style="color: black;">&#40;</span><span style="color: #483d8b;">'127.0.0.1'</span>,<span style="color: black;">&#41;</span>
INSTALLED_APPS += <span style="color: black;">&#40;</span><span style="color: #483d8b;">'debug_toolbar'</span>,<span style="color: black;">&#41;</span></pre>
<p>The code is ugly (and results in the main settings file being parsed <em>twice</em>) but it works!</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/&amp;title=Extending+Settings+Variables+with+local_settings.py+in+Django" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/&amp;title=Extending+Settings+Variables+with+local_settings.py+in+Django" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/&amp;title=Extending+Settings+Variables+with+local_settings.py+in+Django" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/&amp;title=Extending+Settings+Variables+with+local_settings.py+in+Django" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/&amp;t=Extending+Settings+Variables+with+local_settings.py+in+Django" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Extending+Settings+Variables+with+local_settings.py+in+Django+-+http://tinyurl.com/339kgcy+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/&amp;n=Extending+Settings+Variables+with+local_settings.py+in+Django&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=317&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Django Model Templates (sans-Denormalisation)</title>
		<link>http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/</link>
		<comments>http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 13:43:44 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[myuni]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=302</guid>
		<description><![CDATA[I came across an interesting problem recently, while trying to model the structure of a university course in Django. The model needed to represent the notion of a university module, which can be taught over a number of semesters and/or years, by different people, and with different students each time round. Some information remained common [...]]]></description>
			<content:encoded><![CDATA[<p>I came across an interesting problem recently, while trying to model the structure of a university course in Django.</p>
<p>The model needed to represent the notion of a university module, which can be taught over a number of semesters and/or years, by different people, and with different students each time round. Some information remained common to each of these modules however, such as the code, name, and type of the module (single semester or full-year).</p>
<p><span id="more-302"></span></p>
<p>One solution that crossed my mind was to use a sort of template, and copy the common information over each time the module was taught. This would mean duplicating the common fields over a template model and the module's model, and copying the data every time a new "Module" object gets created. This just didn't sit well with me though, as I really don't like denomalising data when it's not absolutely necessary.</p>
<p>The solution I have settled on (for now, anyway) works something like this: I use the model template idea, but with a foreign key from the Module to it's template. Then, to access the fields on the template directly from the Module model, I use a combination of the Python <em>property</em> and a smart lambda function.</p>
<p>Here's a simplified version of the model to illustrate what I'm talking about:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">class</span> ModuleDefinition<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">code</span> = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">6</span>, unique=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    name = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">200</span><span style="color: black;">&#41;</span>
    credits = models.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span>
    level = models.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
    <span style="color: #008000;">type</span> = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">30</span>, choices=MODULE_TYPE_CHOICES<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Module<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">code</span> = <span style="color: #008000;">property</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> s: s._get_definition_property<span style="color: black;">&#40;</span><span style="color: #483d8b;">'code'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    name = <span style="color: #008000;">property</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> s: s._get_definition_property<span style="color: black;">&#40;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    credits = <span style="color: #008000;">property</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> s: s._get_definition_property<span style="color: black;">&#40;</span><span style="color: #483d8b;">'credits'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    level = <span style="color: #008000;">property</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> s: s._get_definition_property<span style="color: black;">&#40;</span><span style="color: #483d8b;">'level'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    definition = models.<span style="color: black;">ForeignKey</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'ModuleDefinition'</span><span style="color: black;">&#41;</span>
    semester = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">20</span>, choices=SEMESTER_CHOICES<span style="color: black;">&#41;</span>
    year = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">20</span>, choices=YEAR_CHOICES<span style="color: black;">&#41;</span>
    convener = models.<span style="color: black;">ForeignKey</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'auth.User'</span>, related_name=<span style="color: #483d8b;">'modules_convened'</span><span style="color: black;">&#41;</span>
    students = models.<span style="color: black;">ManyToManyField</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'auth.User'</span>, blank=<span style="color: #008000;">True</span>, related_name=<span style="color: #483d8b;">'modules_taken'</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> _get_definition_property<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #008000;">property</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">definition</span>.<span style="color: #0000cd;">__getattribute__</span><span style="color: black;">&#40;</span><span style="color: #008000;">property</span><span style="color: black;">&#41;</span></pre>
<p>In this model I've called the template a "definition", but the idea is the same. The <em>_get_definition_property()</em> method allows me to get a property from the parent definition programmatically, which is used in the lambda functions to add the fields from the definition to the model itself, as read-only properties. This allows me to access them as if they were a field stored on the model itself (i.e. <em>module.code</em>, <em>module.name</em>, etc.) which is handy in the templates where <em>module.definition.code</em> would get very old, very fast.</p>
<p>I'd be really interested to hear how others have tackled the same issue, as I'm sure it's not just restricted to university modules. Maybe soon I'll be making a post about how I model a timetable in Django...after all, how hard can it be!?</p>
<p>Oh, and if you're wondering, this code is for the <a title="MyUni" href="http://bitbucket.org/robgolding63/myuni/" target="_blank">MyUni</a> project that is occupying me recently. I'm restricting myself to just <strong>thinking</strong> about how the models could work (and maybe writing little bit of code) until <a title="Robert S. K. Miles" href="http://robertskmiles.com" target="_blank">Rob</a> and <a title="Ben Jenkinson" href="http://benjenkinson.com" target="_blank">Ben</a> come back to university.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/&amp;title=Django+Model+Templates+%28sans-Denormalisation%29" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/&amp;title=Django+Model+Templates+%28sans-Denormalisation%29" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/&amp;title=Django+Model+Templates+%28sans-Denormalisation%29" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/&amp;title=Django+Model+Templates+%28sans-Denormalisation%29" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/&amp;t=Django+Model+Templates+%28sans-Denormalisation%29" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Django+Model+Templates+%28sans-Denormalisation%29+-+http://tinyurl.com/2vugsj2+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/&amp;n=Django+Model+Templates+%28sans-Denormalisation%29&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=302&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2010/04/27/django-model-templates-sans-denormalisation/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>MyUni and Django 1.2</title>
		<link>http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/</link>
		<comments>http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 12:59:36 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[myuni]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=294</guid>
		<description><![CDATA[MyUni is hailed as my "latest venture" on the front page of my website. In fact, it was conceived early last year, when I was in my first year at Nottingham University, by Rob Miles and Ben Jenkinson. We were only just starting to get to grips with this new fad, called Django. The project [...]]]></description>
			<content:encoded><![CDATA[<p><a title="MyUni" href="http://bitbucket.org/robgolding63/myuni/wiki" target="_blank">MyUni</a> is hailed as my "latest venture" on the front page of my website. In fact, it was conceived early last year, when I was in my first year at Nottingham University, by <a title="Robert S. K. Miles" href="http://robertskmiles.com" target="_blank">Rob Miles</a> and <a title="Ben Jenkinson" href="http://benjenkinson.com" target="_blank">Ben Jenkinson</a>. We were only just starting to get to grips with this new fad, called <a title="Django Project" href="http://djangoproject.com" target="_blank">Django</a>.<span id="more-294"></span></p>
<p>The project has gone through several iterations since then, never really reaching any form of completeness. This time round, we are using proper version control (thanks to <a title="Mercurial SCM" href="http://selenic.com/mercurial" target="_blank">Mercurial</a> and <a title="BitBucket" href="http://bitbucket.org" target="_blank">BitBucket</a>), and trying to adhere to Django best practices as much as possible.</p>
<p>Straight from the repository website:</p>
<blockquote><p>MyUni is a portal-style web application for Universities, offering students a central location to access all the relevant information about their course, modules, assignments, and staff members.</p></blockquote>
<p>The project came about because of a passionate hatred for the WebCT system that our university is using, and a general feeling that things could be (and should be) better.</p>
<p>Django 1.2 will bring some really exciting <a title="Django 1.2 Release Notes" href="http://docs.djangoproject.com/en/dev/releases/1.2/" target="_blank">new features</a>, which I am sure would make developing and using MyUni a better experience. One of the things I'm most looking forward to using is the messages framework. I plan to use it for a bunch of things, possibly including form error messages...maybe.</p>
<p>Now, if only the release date would stay in the same place for more than a week!</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/&amp;title=MyUni+and+Django+1.2" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/&amp;title=MyUni+and+Django+1.2" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/&amp;title=MyUni+and+Django+1.2" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/&amp;title=MyUni+and+Django+1.2" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/&amp;t=MyUni+and+Django+1.2" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=MyUni+and+Django+1.2+-+http://tinyurl.com/2drhnmo+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/&amp;n=MyUni+and+Django+1.2&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=294&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2010/04/23/myuni-and-django-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It Begins&#8230;</title>
		<link>http://www.robgolding.com/blog/2009/09/22/it-begins/</link>
		<comments>http://www.robgolding.com/blog/2009/09/22/it-begins/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 17:55:45 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=162</guid>
		<description><![CDATA[The country has just undergone a mass-exodus of university students from their parents' houses back into halls. I played by own small part in blocking up the roads moving back into university accommodation this weekend, and it's all gearing up for the new school year. I've been working with Django more and more lately, and [...]]]></description>
			<content:encoded><![CDATA[<p>The country has just undergone a mass-exodus of university students from their parents' houses back into halls. I played by own small part in blocking up the roads moving back into university accommodation this weekend, and it's all gearing up for the new school year.</p>
<p>I've been working with Django more and more lately, and I've written my first "commercial" application using my new favourite framework - a booking system for taught causes at the City Council. I'm really enjoying writing web applications with Django, and I'm sure this blog will start to resemble a web-developer's in the near future.</p>
<p>Also, I'm really looking forward to this year at university. As I understand it, there's a lot more work to be done, but the software engineering group project should be fun - as long as my "randomly chosen" team are happy with us using Python!</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2009/09/22/it-begins/&amp;title=It+Begins..." rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2009/09/22/it-begins/&amp;title=It+Begins..." rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2009/09/22/it-begins/&amp;title=It+Begins..." rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2009/09/22/it-begins/&amp;title=It+Begins..." rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2009/09/22/it-begins/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2009/09/22/it-begins/&amp;t=It+Begins..." rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=It+Begins...+-+http://tinyurl.com/yeexepf+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2009/09/22/it-begins/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2009/09/22/it-begins/&amp;n=It+Begins...&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=162&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2009/09/22/it-begins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Trials and Tribulations of Django + Git</title>
		<link>http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/</link>
		<comments>http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 21:23:10 +0000</pubDate>
		<dc:creator>Rob Golding</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.robgolding.com/?p=144</guid>
		<description><![CDATA[I just finished my last exam today - Web Programming and Scripting - which explains the distinct lack of activity around here in recent times. Thankfully I could end my exam season on a high, as web programming is, well, what I do - so it wasn't too much of a challenge! Something strange happens [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished my last exam today - Web Programming and Scripting - which explains the distinct lack of activity around here in recent times. Thankfully I could end my exam season on a high, as web programming is, well, what I do - so it wasn't too much of a challenge!</p>
<p>Something strange happens to me every time exams come around. I seem to pick up new projects, and just run with them. This time, I've become involved with a small group of people at university, writing a portal-style information system for universities. I suppose most people call this behavior procrastination, but I'm quite deeply in denial about that.</p>
<p><img class="alignleft" style="margin: 5px 10px;" title="Django Badge" src="http://media.djangoproject.com/img/badges/djangowish126x70.gif" alt="" width="126" height="70" />Ever since my post about the <a href="http://www.robgolding.com/index.php/2009/03/06/my-latest-project-backtrac-backup-system/">Backtrac Backup System</a>, I've been really enjoying using <a href="http://www.djangoproject.com/">Django</a>. Something about it just makes developing for the web, well, exciting. That can only be good, right? I am the designated server administrator for this latest project, mostly due to the fact that I am the only one with a server to administer, and some of the things I've learned so far seem worthy of a mention here.  Firstly, we as developers were - how can I put it - stepping on each other toes somewhat. The project at this point had no version control, so we were just editing a bunch of files over SFTP. Obviously, some sort of Source Control Management was in order. I did some research, and decided that Git was a nice, modern alternative to the ever-popular SVN. It also meant that my server was constantly backed up by everyone on the team - but that's just a bonus!</p>
<p>So, I installed Git, and started a repository. A lot of effort went into learning how the system works, and more importantly, how to make it work for us. Directed Acyclic Graphs thankfully made some sense to me, so I could just about understance the documentation. I wrote some custom hooks, and a C Program to syncronise the web-server. I was happy, and absolutely certain that this was the solution to all our woes. I was mistaken. Git just didn't work the way I had hoped. The custom hooks were throwing permission errors all over the place, and my development team (read: my friend Rob Miles) was locked out of the repository. We made the decision yesterday to scrap Git, and go back to the previous system of editing the files over SFTP. We are always in constant communication when developing for the project, so it's not too big a deal, but I feel that I failed as an adminisrator. You see, as an admin your job isn't just to play with cool toys and loud servers - your primary purpose is to give the users what they need to work, and that is most certainly not what I achieved.</p>
<p>I'm glad I took the time to learn Git - and I'm sure it will help me later in life, in some way or another. It's just unfortunate that it didn't work out the way I had hoped for our project.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://delicious.com/post?url=http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/&amp;title=The+Trials+and+Tribulations+of+Django+%2B+Git" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/&amp;title=The+Trials+and+Tribulations+of+Django+%2B+Git" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/&amp;title=The+Trials+and+Tribulations+of+Django+%2B+Git" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/&amp;title=The+Trials+and+Tribulations+of+Django+%2B+Git" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/&amp;t=The+Trials+and+Tribulations+of+Django+%2B+Git" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=The+Trials+and+Tribulations+of+Django+%2B+Git+-+http://tinyurl.com/yc5ofsu+&amp;source=shareaholic" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/&amp;n=The+Trials+and+Tribulations+of+Django+%2B+Git&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<img src="http://www.robgolding.com/?ak_action=api_record_view&id=144&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.robgolding.com/blog/2009/06/02/the-trials-and-tribulations-of-django-git/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
