<?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>Es Tea Double Eye &#187; django</title>
	<atom:link href="http://stii.co.za/tag/django/feed/" rel="self" type="application/rss+xml" />
	<link>http://stii.co.za</link>
	<description>You&#039;re never too old for a happy childhood</description>
	<lastBuildDate>Fri, 19 Aug 2011 02:20:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<atom:link rel='hub' href='http://stii.co.za/?pushpress=hub'/>
		<item>
		<title>Django tests fail on a new project</title>
		<link>http://stii.co.za/python/django-tests-fail-on-a-new-project/</link>
		<comments>http://stii.co.za/python/django-tests-fail-on-a-new-project/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 22:16:03 +0000</pubDate>
		<dc:creator>Stii</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[unittest]]></category>

		<guid isPermaLink="false">http://stii.co.za/?p=1013</guid>
		<description><![CDATA[This might be slightly confusing at first, but actually makes perfect sense if you think about it. If you have a brand new Django project and you run the tests it fails with a number of errors. # python manage.py test Creating test database... Creating table auth_permission Creating table auth_group Creating table auth_user Creating table [...]]]></description>
			<content:encoded><![CDATA[<p>This might be slightly confusing at first, but actually makes perfect sense if you think about it. If you have a brand new <a href="http://stii.co.za/tag/django">Django</a> project and you run the tests it fails with a number of errors.</p>
<pre>
# python manage.py test
Creating test database...
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Installing index for auth.Permission model
Installing index for auth.Message model
EE..E...EEEEEEE..................
======================================================================
ERROR: test_password_change_fails_with_invalid_old_password (django.contrib.auth.tests.views.ChangePasswordTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/django/contrib/auth/tests/views.py", line 156, in test_password_change_fails_with_invalid_old_password
    'new_password2': 'password1',
  File "/Library/Python/2.6/site-packages/django/test/client.py", line 313, in post
    response = self.request(**r)
  File "/Library/Python/2.6/site-packages/django/core/handlers/base.py", line 92, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/Library/Python/2.6/site-packages/django/contrib/auth/decorators.py", line 78, in __call__
    return self.view_func(request, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/django/contrib/auth/views.py", line 160, in password_change
    }, context_instance=RequestContext(request))
  File "/Library/Python/2.6/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
    return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 103, in render_to_string
    t = get_template(template_name)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 81, in get_template
    source, origin = find_template_source(template_name)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 74, in find_template_source
    raise TemplateDoesNotExist, name
TemplateDoesNotExist: registration/password_change_form.html
...
</pre>
<p>In total 10 tests failed. At first I thought this was wrong. There must be something wrong with my Django installation. I consulted the <a href="http://docs.djangoproject.com/en/1.0/topics/testing/">Django documentation on testing Django apps</a> and all I could pick up was that when you run <strong>python manage.py test</strong> it runs the tests of all your <strong>INSTALLED_APPS</strong> in the <em>settings.py</em> file.</p>
<p>After a bit of searching, I saw a ticket was created for this and was closed with a <em>wontfix</em> resolution. It made sense since it is test cases that was not implemented yet. Doh! <strong>Test Driven Development</strong>.</p>
<p>I do think it could be useful if they added this to the Django docs as a note for n00bs like me.</p>
]]></content:encoded>
			<wfw:commentRss>http://stii.co.za/python/django-tests-fail-on-a-new-project/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Call me anal, but I really like Django templates</title>
		<link>http://stii.co.za/python/call-me-anal-but-i-really-like-django-templates/</link>
		<comments>http://stii.co.za/python/call-me-anal-but-i-really-like-django-templates/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 09:58:31 +0000</pubDate>
		<dc:creator>Stii</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://stii.co.za/?p=962</guid>
		<description><![CDATA[For all the wrong reasons, but still! I just love the fact that it actually uses a .html extension. Am I weird? I do feel a bit weird that I like something so arb. So the template files use the extension of what it actually contains? Wow, I love that. Revolutionary. Don&#8217;t ask me why [...]]]></description>
			<content:encoded><![CDATA[<p>For all the wrong reasons, but still! I just <em>love</em> the fact that it actually uses a <strong>.html extension</strong>. Am I weird? I do feel a bit weird that I like something so arb. So the template files use the extension of what it actually contains? Wow, I love that. Revolutionary. Don&#8217;t ask me why I just thought of that&#8230; I cannot answer that truthfully :P Feels like I&#8217;m being anal, since it doesn&#8217;t seem to matter to anyone else. Most other web development frameworks uses other file extensions. For example in PHP frameworks, the template files have a .php extension. Must be this glorious <strong>Rocktober</strong> day in Cape Town that is doing this to me!</p>
<p><a href="http://djangoproject.com"><img src="http://stii.co.za/wp-content/uploads/2009/04/django-logo-positive-400x139.png" alt="django-logo-positive" title="django-logo-positive" width="400" height="139" class="alignnone size-medium wp-image-574" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stii.co.za/python/call-me-anal-but-i-really-like-django-templates/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Django with apache and mod_wsgi issues</title>
		<link>http://stii.co.za/python/django-with-apache-and-mod_wsgi-issues/</link>
		<comments>http://stii.co.za/python/django-with-apache-and-mod_wsgi-issues/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 18:47:58 +0000</pubDate>
		<dc:creator>Stii</dc:creator>
				<category><![CDATA[Mobile Web]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[mod_wsgi]]></category>

		<guid isPermaLink="false">http://stii.co.za/?p=570</guid>
		<description><![CDATA[I ran into a fairly common error while setting up Django with mod_wsgi and Apache on Debian. What irritates me about it is that I didn&#8217;t pick it up right away, but I&#8217;ll blame the long Easter weekend for that. :P ImportError: Could not import settings 'mysite.settings' (Is it on sys.path? Does it have syntax [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a fairly common error while setting up <a href="http://stii.co.za/tag/django">Django</a> with <strong>mod_wsgi</strong> and <strong>Apache</strong> on <strong>Debian</strong>. What irritates me about it is that I didn&#8217;t pick it up right away, but I&#8217;ll blame the long Easter weekend for that. :P </p>
<p><img src="http://stii.co.za/wp-content/uploads/2009/04/django-logo-positive-400x139.png" alt="django-logo-positive" title="django-logo-positive" width="400" height="139" class="aligncenter size-medium wp-image-574" /></p>
<pre>
ImportError: Could not import settings 'mysite.settings'
(Is it on sys.path? Does it have syntax errors?):
No module named mysite.settings
</pre>
<p>My wsgi file looked like this:</p>
<pre>
import os, sys
sys.path.append('/home/djangoprojects/mysite/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi

_application = django.core.handlers.wsgi.WSGIHandler()

def application(environ, start_response):
    if environ['wsgi.url_scheme'] == 'https':
        environ['HTTPS'] = 'on'
    return _application(environ, start_response)
</pre>
<p>Like an idiot, I was looking everywhere for the issue, accept the glaring obvious reason. I checked permissions, created a .pth file for the project in the <strong>/site-packages/</strong> directory in the Python library. Trust me, I did everything, but the obvious thing.</p>
<p>See, here is that obvious reason:</p>
<p>I append the directory &#8220;<strong>/home/djangoprojects/mysite</strong>&#8221; to my <strong>sys.path</strong> which is wrong. Python then looks for the module &#8220;<strong>mysite</strong>&#8221; in the directory <strong>/home/djangoprojects/mysite</strong> which in fact doesn&#8217;t exist. Obvious, no? </p>
<p>To fix this problem, you need to append the directory &#8220;<strong>/home/djangoprojects/</strong>&#8221; to your <strong>sys.path</strong> and it will find the module <strong>mysite.settings</strong> no problem and it will run smooth.</p>
<p>Long weekend, surf on the brain. That&#8217;s what is wrong!</p>
]]></content:encoded>
			<wfw:commentRss>http://stii.co.za/python/django-with-apache-and-mod_wsgi-issues/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Back on WordPress</title>
		<link>http://stii.co.za/wordpress/back-on-wordpress/</link>
		<comments>http://stii.co.za/wordpress/back-on-wordpress/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 08:48:35 +0000</pubDate>
		<dc:creator>Stii</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[lifestyle]]></category>

		<guid isPermaLink="false">http://stii.co.za/?p=3</guid>
		<description><![CDATA[Okay, right, I feel bit stupid doing this, but due to some massive changes in my life the past couple of months I had to reconsider my priorities and get my ducks in a row. I have not been blogging in two months now, which is quite shocking! I started to feel like I&#8217;m neglecting [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, right, I feel bit stupid doing this, but due to some massive changes in my life the past couple of months I had to reconsider my priorities and get my ducks in a row. I have not been blogging in two months now, which is quite shocking! I started to feel like I&#8217;m neglecting something very important in my life&#8230; and I have!</p>
<p><img src="http://farm3.static.flickr.com/2260/2505280998_729a7b7bd2_m.jpg" alt="Wordpress Gone fishing" /></p>
<p>Therefore, I&#8217;m putting my <a href="http://djangoproject.com/">Django</a> blog on the back-burner for now as I dearly love it, but at the same time I simply do not have time to tinker. I will tinker in future if and only if there is spare time. Of which there is none. </p>
<p>I came to the realisation that it is much more important at the moment to write/blog than what it is to tinker with Django. <a href="http://afrigator.com"><strong>Afrigator</strong></a> has become a very serious &#8220;project&#8221; all of a sudden, thus I cannot simply tinker as I feel anymore. I need to focus and need to communicate. </p>
<p>Fortunately for me, I&#8217;m still very much busy with <a href="http://python.org">Python</a> stuff on the Afrigator back-end, so I&#8217;m not <strong>COMPLETELY</strong> miffed about it! In fact, I&#8217;m loving it&#8230;</p>
<p>Oh and if you wondered about the picture and where the hell it fits in with all this, forget about it&#8230; I just like the pic as I&#8217;m proud of my son&#8217;s catch. Not everything in life <strong>HAS</strong> to make sense now, does it?</p>
]]></content:encoded>
			<wfw:commentRss>http://stii.co.za/wordpress/back-on-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

