Django for a Rails Developer

November 26, 2009

This is not yet another Django vs Rails blog post. It is a compilation of notes I made working with Django after having worked on Rails for years.

In this post I want to give a brief introduction to Django project layout from a Rails developer point of view, on what is there, what is not [...]

Read the full article →

The magic of metaclasses in Python

November 21, 2009

Metaclasses are a way for you to have a class act as the template for another class. They are simlar to a classfactory, in that they create new classes. In words of Tim Peters Metaclasses are deeper magic than 99% of people are going to need.

However, in right hands they can be a potent tool, in [...]

Read the full article →

Writing your own template loaders

November 21, 2009

Django has three builtin template loaders which are used to get the templates for rendering.

TEMPLATE_LOADERS = ( ‘django.template.loaders.filesystem.load_template_source’, ‘django.template.loaders.app_directories.load_template_source’, # ‘django.template.loaders.eggs.load_template_source’, )

Writing your template loader is a awfuly easy. It is a callable which

Returns a tuple of (openfile, filename) if it can find the template. Raise TemplateDoesNotExist if [...]

Read the full article →

Django gotchas

November 11, 2009

This is announcement about our new work, Django Gotchas, a teeny tiny ebook about commonly occurring gotchas with Django. Here is the readme copied from the project.

Django-gotchas is a collections of gotchas which happen commonly when you are working with Django. They are some errors which I have made commonly or seen others do, these [...]

Read the full article →

Pycon India 2009 : A Review

October 2, 2009

Pycon India concluded last weekend at Indian Institute of Science, Bangalore.

There have been so many python/django conferences recently, I have been tracking them literally all through the year. Another one, SciPy India just got announced. Week long, with sprints!

Pycon India was attended by around 350 people and had 30 talks. I have attended many conferences, [...]

Read the full article →

Beginning python

September 18, 2009

Slides and code from my talk at twincling.

Beginning PythonView more documents from Usware Technologies.

Talk CodeView more documents from Usware Technologies.

Read the full article →

Django-SocialAuth – Login via twitter, facebook, openid, yahoo, google using a single app.

August 27, 2009

TL;DR version: Here is an app to allow logging in via twitter, facebook, openid, yahoo, google, which should work transparently with Django authentication system. (@login_required, User and other infrastructure work as expected.) Demo and Code.Longer version follow:

We are releasing our new app. Django-Socialauth. This app makes it awfully easy, to allow users to login your site [...]

Read the full article →

A response to Dropping Django

August 20, 2009

Brandon Bloom yesterday wrote an interesting post titled dropping Django. Despite a lot of hand waving(We needed a pragmatic template language to replace Django’s idealistic one.), it raises some valid questions, so here is a solution to some of them.

No support for hierarchical url creation.

The simplest representation of nested urls I can think of is a nested [...]

Read the full article →

Django aggregation tutorial

August 18, 2009

One of the new and most awaited features with Django 1.1 was aggregation. As usual, Django comes with a very comprehensive documentation for this. Here, I have tried to put this in how-to form.

Jump to howtos or Get source on Github.

Essentially, aggregations are nothing but a way to perform an operation on group of rows. In databases, they [...]

Read the full article →

Aren’t django signals a little like comefrom?

July 18, 2009

In computer programming, COMEFROM (or COME FROM) is an obscure control flow structure used in some programming languages, primarily as a joke.

I never liked using signals. Recently I was asked that, and has no answer, but a little thinking led me to this question. Aren’t signals a little like COMEFROM. If yes, aren’t they as bad [...]

Read the full article →