<?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>To Blog or Not To Blog &#187; django</title>
	<atom:link href="http://adil.2scomplement.com/category/programming/django/feed/" rel="self" type="application/rss+xml" />
	<link>http://adil.2scomplement.com</link>
	<description></description>
	<lastBuildDate>Thu, 24 Dec 2009 14:55:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>django: Hacking django object_list to take list of templates</title>
		<link>http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates</link>
		<comments>http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 07:29:56 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web-Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[object_list]]></category>
		<category><![CDATA[select_template]]></category>
		<category><![CDATA[template_loader]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=244</guid>
		<description><![CDATA[I recently found that you can pass a list or tuple to both django.template.loader.render_to_string and django.shortcuts.render_to_response. These functions iterate over the list of templates and render the first template that exists. The magic lies with the django.template.loader.get_template and select_template functions which take a single template name or list of templates respectively.
This is a great functionality [...]


No related posts.]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>django: How to get model class from model name</title>
		<link>http://adil.2scomplement.com/2009/06/django-how-to-get-model-class-from-model-class-name/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-how-to-get-model-class-from-model-class-name</link>
		<comments>http://adil.2scomplement.com/2009/06/django-how-to-get-model-class-from-model-class-name/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 07:17:52 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web-Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[class from string]]></category>
		<category><![CDATA[ContentType]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=170</guid>
		<description><![CDATA[How do you get the model class object from a string containing model name?
This came up multiple times during SeenReport development. While recording views, saving votes and adding comment on an object, I had to get the model class using the model name. The scenario would be,

The view receives the model name and object id
Fetch [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2009/06/django-how-to-get-model-class-from-model-class-name/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>django: How to expire session on browser close</title>
		<link>http://adil.2scomplement.com/2009/04/django-how-to-expire-session-on-browser-close/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-how-to-expire-session-on-browser-close</link>
		<comments>http://adil.2scomplement.com/2009/04/django-how-to-expire-session-on-browser-close/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 14:43:20 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web-Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[browser close]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[set_expiry]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=94</guid>
		<description><![CDATA[django employs cookies to track the user session. settings.SESSION_COOKIE_AGE defines the session expiration age in seconds. So, the user logs in once and can stay logged in for hours (even days).
But what if a user wants the session to expire as soon as the browser is closed? This is perfectly desirable for users on public/shared [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2009/04/django-how-to-expire-session-on-browser-close/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>django: generating absolute URLs</title>
		<link>http://adil.2scomplement.com/2009/02/django-generating-absolute-urls/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-generating-absolute-urls</link>
		<comments>http://adil.2scomplement.com/2009/02/django-generating-absolute-urls/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 15:05:05 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web-Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[absolute urls]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=90</guid>
		<description><![CDATA[As I mentioned earlier, django provides a convenient and highly de-coupled way to manipulate URLs. At the heart of this functionality is django.core.urlresolver.reverse. This function however generates relative URLs e.g. /album/my-first-album/
At See&#8217;n'Report, we wanted every user to have a sub-domain so, hitting http://username.seenreport.com takes you to the user profile. But this created a small problem; all [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2009/02/django-generating-absolute-urls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>django: playing with upload_to field</title>
		<link>http://adil.2scomplement.com/2009/01/django-playing-with-upload_to-field/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-playing-with-upload_to-field</link>
		<comments>http://adil.2scomplement.com/2009/01/django-playing-with-upload_to-field/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 15:35:34 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[dynamic path]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=88</guid>
		<description><![CDATA[Django provides models.FileField &#38; models.ImageField to save uploaded files &#38; images respectively. Both these fields take a parameters &#8216;upload_to&#8217; which defines the path where the uploaded file will be saved (complete path is settings.MEDIA_ROOT + upload_to). You can play some neat tricks with this little feature.
Creating the date based folders at run time
You can use the [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2009/01/django-playing-with-upload_to-field/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>django: using reverse instead of hardcoded URLs</title>
		<link>http://adil.2scomplement.com/2009/01/django-using-reverse-instead-of-hardcoded-urls/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-using-reverse-instead-of-hardcoded-urls</link>
		<comments>http://adil.2scomplement.com/2009/01/django-using-reverse-instead-of-hardcoded-urls/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 10:41:51 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[reverse]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[web programming]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=87</guid>
		<description><![CDATA[django urls are a unique and neat way to abstract the urls from implementation. It is encouraged not to hard code the urls in templates to maintain abstraction. For templates, django provides a tag called url that you should use to render your urls. You can also name a url and refer to it using that name in this tag. [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2009/01/django-using-reverse-instead-of-hardcoded-urls/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>django: using threading to speed up send_mail</title>
		<link>http://adil.2scomplement.com/2008/11/django-send_mail-improved/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-send_mail-improved</link>
		<comments>http://adil.2scomplement.com/2008/11/django-send_mail-improved/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 14:51:02 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web-Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[non-blocking]]></category>
		<category><![CDATA[send_mail]]></category>
		<category><![CDATA[threading]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=76</guid>
		<description><![CDATA[django.core.mail.send_mail provides a very convenient abstraction to send an email to multiple recipients. But calling send_mail is a blocking call. This means that if you want to send an email in response to a user action, the server will not respond till the email is sent. This problem is magnified when you have to send [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2008/11/django-send_mail-improved/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>django: Migrating to Admin-newforms made easy</title>
		<link>http://adil.2scomplement.com/2008/09/django-migrating-to-admin-newforms-made-easy/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-migrating-to-admin-newforms-made-easy</link>
		<comments>http://adil.2scomplement.com/2008/09/django-migrating-to-admin-newforms-made-easy/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 03:42:40 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[django 1.0]]></category>
		<category><![CDATA[migrating]]></category>
		<category><![CDATA[newforms-admin]]></category>
		<category><![CDATA[web programming]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=62</guid>
		<description><![CDATA[I have been a great admirer of simplicity of django. So I was rather disappointed when I saw the newforms-admin. Using newforms-admin requires more code, more named classes and more work  . This is a simple comparison of how to use admin functionality before and after the changes.
Before

#file models.py
from django.db import models
class MyModel&#40;models.Model&#41;:
  [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2008/09/django-migrating-to-admin-newforms-made-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>django: Resolving &#8220;The model &#8216;MyModel&#8217; is already registered&#8221; error</title>
		<link>http://adil.2scomplement.com/2008/09/django-the-model-mymodel-is-already-registered/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-the-model-mymodel-is-already-registered</link>
		<comments>http://adil.2scomplement.com/2008/09/django-the-model-mymodel-is-already-registered/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 03:13:02 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web-Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[1.0]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=66</guid>
		<description><![CDATA[If you are migrating to django 1.0, youll have to update your models.py for django newforms-admin
Before

from django.db import models
class MyModel&#40;models.Model&#41;:
      &#34;&#34;&#34;
      field definitions
      &#34;&#34;&#34;
&#160;
      class Admin
          [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2008/09/django-the-model-mymodel-is-already-registered/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>django: extending User model at run-time</title>
		<link>http://adil.2scomplement.com/2008/08/django-extending-user-model-at-run-time/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-extending-user-model-at-run-time</link>
		<comments>http://adil.2scomplement.com/2008/08/django-extending-user-model-at-run-time/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 10:51:22 +0000</pubDate>
		<dc:creator>Adil Saleem</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[extending]]></category>
		<category><![CDATA[run-time]]></category>
		<category><![CDATA[User]]></category>
		<category><![CDATA[Web-Development]]></category>

		<guid isPermaLink="false">http://adil.2scomplement.com/?p=64</guid>
		<description><![CDATA[Any developer working in django must be familiar with django.contrib.auth.models.User class. It contains a set of basic attributes and methods. Fo small scale projects, these functionalities are more than sufficient. But most of the times you feel the need to store additional information about a user. django comes equippd with a mechanism to define an [...]


Related posts:<ol><li><a href='http://adil.2scomplement.com/2009/12/django-hacking-django-views-generic-list_detail-object_list-to-take-list-of-templates/' rel='bookmark' title='Permanent Link: django: Hacking django object_list to take list of templates'>django: Hacking django object_list to take list of templates</a></li></ol>]]></description>
		<wfw:commentRss>http://adil.2scomplement.com/2008/08/django-extending-user-model-at-run-time/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
