<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Django on Personal Site of Tim Child</title>
    <link>/categories/django/</link>
    <description>Recent content in Django on Personal Site of Tim Child</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 13 Aug 2012 07:52:59 +0000</lastBuildDate>
    
	<atom:link href="/categories/django/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Profiling Django applications – part2</title>
      <link>/2012/08/13/profiling-django-applications-part2/</link>
      <pubDate>Mon, 13 Aug 2012 07:52:59 +0000</pubDate>
      
      <guid>/2012/08/13/profiling-django-applications-part2/</guid>
      <description>Profiling using CProfile.
Sometimes it is advantageous to look at what your application is doing before it goes in to production. Using tools like iPDB and PDB we can step through code, particularly in the view that you are working on, but it doesn&amp;#8217;t tell the full picture of what is going on up-until that view is called, or after the HTTPResponse is starting to be returned.
It is easy to start profiling django runserver using CProfile:</description>
    </item>
    
    <item>
      <title>Profiling Django applications – part1</title>
      <link>/2012/05/10/profiling-django-applications-part1/</link>
      <pubDate>Thu, 10 May 2012 08:09:51 +0000</pubDate>
      
      <guid>/2012/05/10/profiling-django-applications-part1/</guid>
      <description>I have been doing some profiling of a Django application in different ways, and this is something that can be very useful to understand where bottlenecks are, why code behaves in certain ways and where we can trim the fat.
There are multiple places where we can profile Django, and many of the pointers and resources from Python at large can be used when profiling Django. Things like Hotshot, cProfile and timeit are available, and there are helper libraries around these tools.</description>
    </item>
    
    <item>
      <title>Celery ghetto queue</title>
      <link>/2012/04/27/celery-ghetto-queue/</link>
      <pubDate>Fri, 27 Apr 2012 06:59:57 +0000</pubDate>
      
      <guid>/2012/04/27/celery-ghetto-queue/</guid>
      <description>Currently wondering how the ghetto queue might work for smaller installations.
I have done larger installations using RabbitMQ, celery&amp;#8217;s preferred message mechanism, but for smaller loads and services running straight from django and postgres might be a good idea.
I guess it maintains the flexibility of having an upgrade path but is less to install and maintain, thus being kinder to sysadmins and support staff.
Going to try it I think.</description>
    </item>
    
    <item>
      <title>Django Select Multiple filter.</title>
      <link>/2010/11/02/django-select-multiple-filter/</link>
      <pubDate>Tue, 02 Nov 2010 16:33:28 +0000</pubDate>
      
      <guid>/2010/11/02/django-select-multiple-filter/</guid>
      <description>Django has a really nice select multiple field, for choosing multiple items at once with a Javascript chooser..

It is really handy to use when there is a large number of items that have to be chosen from in a select. I am using with JQuery.
To do this, grab SelectFilter2.js from the django-admin media folder, or get it from Django&amp;#8217;s GitHub repository. Then to initialize it you can put the following into your code:</description>
    </item>
    
    <item>
      <title>Django localization and internationalization</title>
      <link>/2010/10/19/django-localization-and-internationalization/</link>
      <pubDate>Tue, 19 Oct 2010 21:50:07 +0000</pubDate>
      
      <guid>/2010/10/19/django-localization-and-internationalization/</guid>
      <description>We have been using the localization and internationalization ( l10n&amp;amp; i18n ) from Django quite a bit for our translations, and although we haven&amp;#8217;t had to tackle anything difficult like Arabic or Persian yet there are still some shortcomings in the system.
The standard Django module for input of dates and datetime stamps is quite restrictive. It depends on a module, I think written by Simon Willson which uses the PHP notation rather than the Python/C strftime / strptime notation.</description>
    </item>
    
    <item>
      <title>Django 1.2 release</title>
      <link>/2010/05/15/django-1-2-release/</link>
      <pubDate>Sat, 15 May 2010 08:07:46 +0000</pubDate>
      
      <guid>/2010/05/15/django-1-2-release/</guid>
      <description>It was just announced that Django 1.2 will be released on May 17th, which is in 3 days time.
Been waiting a while for this one to go to production release so I am really glad. The new messages framework looks much better, and I also love the date i18n features &amp;#8211; something that really helps on a project at Cantemo where we have to deal with ISO formatted datetimes.</description>
    </item>
    
    <item>
      <title>Python plugin systems</title>
      <link>/2010/04/22/python-plugin-systems/</link>
      <pubDate>Thu, 22 Apr 2010 11:01:17 +0000</pubDate>
      
      <guid>/2010/04/22/python-plugin-systems/</guid>
      <description>There is a lot of interesting information about creating plugin architectures using Python all over the web, but its in fairly disparate places. This is an overview of the documentation that I found as of April 2010.
Firstly Dr André Roberge has some very interesting posts, as well as a talk at PyCon 2009 on Blip.tv entitled Plugins and monkeypatching: increasing flexibility, dealing with inflexibility. He is also the author of Crunchy which uses a plugin system.</description>
    </item>
    
    <item>
      <title>Django on RedHat or CentOS</title>
      <link>/2010/03/26/django-on-redhat-or-centos/</link>
      <pubDate>Fri, 26 Mar 2010 10:07:21 +0000</pubDate>
      
      <guid>/2010/03/26/django-on-redhat-or-centos/</guid>
      <description>I am normally using Debian, Ubuntu or even Suse for deploying Django, but a recent customer needed to deploy on Red Hat Enterprise Server 5.
We decided beforehand to test deployment on RHEL5 and also on CentOS 5.4 and so these instructions should work for both environments. NginX will be used as the webserver.
The first thing I like to do is to upgrade the repository and add EPEL. This wasn&amp;#8217;t needed I found on the RedHat box I was using, but was needed on CentOS but your mileage might vary.</description>
    </item>
    
    <item>
      <title>Django staff member required</title>
      <link>/2010/03/13/django-staff-member-required/</link>
      <pubDate>Sat, 13 Mar 2010 09:30:50 +0000</pubDate>
      
      <guid>/2010/03/13/django-staff-member-required/</guid>
      <description>Here is a simple decorator that isn&amp;#8217;t mentioned properly in the Django documentation.
[cc lang=&amp;ldquo;python&amp;rdquo;]@staff_member_required[/cc]
It basically checks to see if the user is logged in and has is_staff before allowing a user access to the view. Use like you would the normal
@login_required decorator.
[cc lang=&amp;ldquo;python&amp;rdquo;]
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.contrib.admin.views.decorators import staff_member_required
@staff_member_required
def my_view(request):
return render_to_response(&amp;#8216;page.html&amp;#8217;,
context_instance=RequestContext(request))
[/cc]</description>
    </item>
    
    <item>
      <title>Extending Django’s user admin</title>
      <link>/2010/02/18/extending-djangos-user-admin/</link>
      <pubDate>Thu, 18 Feb 2010 22:06:23 +0000</pubDate>
      
      <guid>/2010/02/18/extending-djangos-user-admin/</guid>
      <description>The built in admin pages that you get in Django can be useful, but they particularly become useful once you start to add a lot more functionality to them.
For instance the Django&amp;#8217;s User authentication system (which lives in django.contrib.auth ) is widely used, and quite often you need to extend the user&amp;#8217;s profile by using AUTH_PROFILE_MODULE and a separate model. But having a separate Admin screen for this is kind of pointless.</description>
    </item>
    
    <item>
      <title>gcc and python</title>
      <link>/2010/02/18/gcc-and-python/</link>
      <pubDate>Thu, 18 Feb 2010 14:18:14 +0000</pubDate>
      
      <guid>/2010/02/18/gcc-and-python/</guid>
      <description>Had an interesting little problem with gcc and python today on OS X 10.6.
Basically I was trying to use graphviz and pygraphviz, and installing from source I got messages like this:
[cc lang=&amp;ldquo;bash&amp;rdquo;]
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/include/graphviz -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.3-i386-2.5/pygraphviz/graphviz_wrap.o
cc1: error: unrecognized command line option &amp;#8220;-Wno-long-double&amp;#8221;
cc1: error: unrecognized command line option &amp;#8220;-Wno-long-double&amp;#8221;</description>
    </item>
    
    <item>
      <title>Django settings in template</title>
      <link>/2010/01/22/django-settings-in-template/</link>
      <pubDate>Fri, 22 Jan 2010 10:51:18 +0000</pubDate>
      
      <guid>/2010/01/22/django-settings-in-template/</guid>
      <description>So what do you do if you require a django setting in your templates, much like we have MEDIA_URL today?
Well there are use cases for this, (if you are in doubt have a look at the original ticket for adding MEDIA_URL to django ).
The easiest way that I have found so far is to write a context processor. For example in my settings I might have JAVASCRIPT_URL (which in my real life code changes depending on whether I am running in debug, test or from a CDN):</description>
    </item>
    
    <item>
      <title>Leading zeros in django</title>
      <link>/2009/07/13/leading-zeros-in-django/</link>
      <pubDate>Mon, 13 Jul 2009 11:28:55 +0000</pubDate>
      
      <guid>/2009/07/13/leading-zeros-in-django/</guid>
      <description>I am always forgetting about the stringformatting tag in Django&amp;#8217;s templating language. For instance for leading zeros:
&amp;lt;br /&amp;gt; {{ variable|stringformat:&amp;ldquo;02d&amp;rdquo; }}&amp;lt;br /&amp;gt; 
This will always put a leading zero.</description>
    </item>
    
    <item>
      <title>Django test fixtures and contenttypes</title>
      <link>/2009/05/29/django-test-fixtures-and-contenttypes/</link>
      <pubDate>Fri, 29 May 2009 03:46:38 +0000</pubDate>
      
      <guid>/2009/05/29/django-test-fixtures-and-contenttypes/</guid>
      <description>Just came across an interesting problem with the contenttypes contributed application and the test framework.
If you are using fixtures in the test frame work you might find that the database gets out of date as you are working on it, particularly if you are creating new models all the time.
To get around this you need to regenerate the contenttypes database. If you depend on this, the following steps could give you problems so make sure that you back up your data (dumpdata) beforehand.</description>
    </item>
    
    <item>
      <title>django one form, two models</title>
      <link>/2008/06/21/django-one-form-two-models/</link>
      <pubDate>Sat, 21 Jun 2008 10:25:04 +0000</pubDate>
      
      <guid>/2008/06/21/django-one-form-two-models/</guid>
      <description>This post is a work in progress is now working I am glad to say. I have been working on a django site which needs two models updated for one post. It is actually using models very close to that on django-forums and I have created a forms.py file:
&amp;lt;br /&amp;gt; class ThreadForm(forms.ModelForm):&amp;lt;br /&amp;gt; class Meta:&amp;lt;br /&amp;gt; model = Thread&amp;lt;br /&amp;gt; exclude = (&amp;lsquo;forum&amp;rsquo;, &amp;lsquo;sticky&amp;rsquo;, &amp;lsquo;closed&amp;rsquo;, &amp;lsquo;posts&amp;rsquo;, &amp;lsquo;views&amp;rsquo;, &amp;lsquo;latest_post_time&amp;rsquo;)&amp;lt;/p&amp;gt; &amp;lt;p&amp;gt; def clean_title(self):&amp;lt;br /&amp;gt; title = self.</description>
    </item>
    
    <item>
      <title>Looks like Django is really taking off</title>
      <link>/2008/04/18/looks-like-django-is-really-taking-off/</link>
      <pubDate>Fri, 18 Apr 2008 09:42:56 +0000</pubDate>
      
      <guid>/2008/04/18/looks-like-django-is-really-taking-off/</guid>
      <description>Since the introduction of Google&amp;#8217;s appengine which includes support for some of Django&amp;#8217;s code, and the template system there has been an incredible amount of press for Django.
At the moment there is no backend support for AppEngine in Django (and DB2 support is still lacking &amp;#8211; there was a blog post about a year ago but nothing seems to have happened since, and I would love to be proved wrong on that one) but it must only be a matter of time before this happens so for the moment you have to disable the ORM support.</description>
    </item>
    
    <item>
      <title>Django and URLS naming</title>
      <link>/2008/03/13/django-and-urls-naming/</link>
      <pubDate>Thu, 13 Mar 2008 18:51:20 +0000</pubDate>
      
      <guid>/2008/03/13/django-and-urls-naming/</guid>
      <description>Django URLs naming can be a pain sometimes, unless it is just me but an easy way to debug is to use Django&amp;#8217;s shell and import urlresolvers:
&amp;lt;/p&amp;gt; &amp;lt;p&amp;gt;python manage.py shell&amp;lt;/p&amp;gt; &amp;lt;p&amp;gt;&amp;gt;&amp;gt; from django.core.urlresolvers import reverse&amp;lt;br /&amp;gt; &amp;gt;&amp;gt; reverse(&amp;lsquo;nameofurl&amp;rsquo;)&amp;lt;br /&amp;gt; 
If there are arguments in the URLS field (for instance passing in the slug):
&amp;lt;br /&amp;gt; &amp;gt;&amp;gt; reverse(&amp;lsquo;nameofurl&amp;rsquo;, &amp;lsquo;slug&amp;rsquo;) [/sourcecode]&amp;lt;br /&amp;gt; 
Then it should resolve the name to the URL path needed.</description>
    </item>
    
    <item>
      <title>Django and OSX</title>
      <link>/2007/07/09/django-and-osx/</link>
      <pubDate>Mon, 09 Jul 2007 21:56:23 +0000</pubDate>
      
      <guid>/2007/07/09/django-and-osx/</guid>
      <description>Those who have been here before know that I am a big fan of the Django python webframework, and also a big fan of OS X. So I thought that I would install Django on my MacBook Pro.
I did have it all installed on my G4 laptop, but I am going to be using it with at least two different databases on this machine. I am not going to give a complete, what I typed style install, just an overview because it is fairly easy.</description>
    </item>
    
    <item>
      <title>Django site comments and all!</title>
      <link>/2006/10/08/django-site-comments-and-all/</link>
      <pubDate>Sun, 08 Oct 2006 15:25:00 +0000</pubDate>
      
      <guid>/2006/10/08/django-site-comments-and-all/</guid>
      <description>I haven&amp;#8217;t been posted that much here recently and thats because I have been doing other things and working on other sites. I have also built a new server for home, which will be detailed later, but first and foremost I am still playing with Django and build a site using it.
I have had enough with doing WordPress sites, and although I do know it fairly well I wanted to write something a bit more tailored to the application.</description>
    </item>
    
    <item>
      <title>django with apache2</title>
      <link>/2006/07/26/django-with-apache2/</link>
      <pubDate>Wed, 26 Jul 2006 18:31:40 +0000</pubDate>
      
      <guid>/2006/07/26/django-with-apache2/</guid>
      <description>One thing that I feel is harder than it should be with django is getting it working with Apache2. Sure the built in webserver is nice for development, but there comes a time when you need to step up and use a webserver for development that you can also deploy the site upon.
I have used Apache a lot in the past, but recently I have decided to move over to installing everything the Debian way, and this will reflect that.</description>
    </item>
    
    <item>
      <title>Top 30 Django Tutorials and Articles</title>
      <link>/2006/07/20/top-30-django-tutorials-and-articles/</link>
      <pubDate>Thu, 20 Jul 2006 19:33:11 +0000</pubDate>
      
      <guid>/2006/07/20/top-30-django-tutorials-and-articles/</guid>
      <description>Here&amp;#8217;s a list of 30 helpful tutorials and/or articles on the Django web framework. This was written as an answer to the Top 30 Ruby on Rails tutorials and it is really helpful when you are learning Django. Hopefully this will help it get even more support.
read more&amp;nbsp;|&amp;nbsp;digg story</description>
    </item>
    
    <item>
      <title>Django setup</title>
      <link>/2006/07/11/django-setup/</link>
      <pubDate>Tue, 11 Jul 2006 19:29:17 +0000</pubDate>
      
      <guid>/2006/07/11/django-setup/</guid>
      <description>Over the last few days I have been playing with Django quite alot, installing it on a couple of machines and on Dreamhost. The Dreamhost configuration is now well documented by Jeff Croft in his post: http://www2.jeffcroft.com/2006/may/11/django-dreamhost/ and the on Dreamhost Wiki here: http://wiki.dreamhost.com/index.php/Django
I did seem to use a few different settings on the file:
django.fcgi:
#!/usr/bin/env python import sys sys.path += [&#39;/home/timc3/django/django_src&#39;] sys.path += [&#39;/home/timc3/django/django_projects&#39;] from fcgi import WSGIServer from django.</description>
    </item>
    
    <item>
      <title>Interesting Django video</title>
      <link>/2006/06/15/interesting-django-video/</link>
      <pubDate>Thu, 15 Jun 2006 07:35:42 +0000</pubDate>
      
      <guid>/2006/06/15/interesting-django-video/</guid>
      <description>Nice hour long video on Django, from a google presentation here:
http://video.google.com/videoplay?docid=-70449010942275062
Worth watching if you are thinking about getting in to the Django framework.</description>
    </item>
    
    <item>
      <title>django and python</title>
      <link>/2006/05/29/django-and-python/</link>
      <pubDate>Mon, 29 May 2006 20:12:07 +0000</pubDate>
      
      <guid>/2006/05/29/django-and-python/</guid>
      <description>At Vizrt there is alot of python, and although I wish I could have jumped on the bandwagon and started messing around more with Ruby, I am enjoying working with python where the scripts are properly authored.
So I was looking for a nice framework that would give me Rails style speed of prototyping web applications whilst using Python and after looking at the usual suspects (Turbogears, pylons, zope &amp;amp; plone) I am again playing around with Django again.</description>
    </item>
    
  </channel>
</rss>