Django

django-behave

I like BDD. I like cucumber. I like python. I like django. I don’t like lettuce, a commonly-used python port of cucumber, when used with django. They’ve chosen the completely daft option to use your main database when testing. I’d forgotten this, so when I discovered I’d torched my production database just because I wanted to write a test, I decided to not touch lettuce again… And then I discovered behave, which works fine as a python BDD tool; except it doesn’t have an easy tie-up with django.

Django GeoIP templatetag

I’ve published 2 template tags for use with GeoIP at geoip.py. Hope they may be of use… Usage: Templatetag get_country_name returns the client’s country code # Example: {% ifequal get_country “GB” %} do something {% endifequal %} Templatetag get_country sets the given variable name to the client’s country code # Example: {% get_country as my_country %} {% ifequal my_country “GB” %} do something {% endifequal %}

Django/Ajax: a great simple tutorial

An excellent tutorial from James Bennett for your first step into combining AJAX with Django “A step-by-step walk through a simple AJAX form with Django backend”

Django search engine

To help me get to grips with Django quickly, I created a search engine of the documentation. On the off-chance this is useful to others, I made it available at http://www.hobthross.com/docs/django/phpdig/search.php (Sorry if this does not show up as a hyperlink, WordPress appears to be chewing that up and ignoring it)

Django for Python websites

I’ve just taken a look at Django for the first time, and am seriously impressed. For a while now, I’ve been trying to find a way of using Python in websites, and haven’t found anything that works well enough - Zope, Cheetah, mod_python - all seem very difficult to get the simplest thing working… But Django looks like the answer. The guys behind Django have produced a very useful tutorial to help you get going with it, and the users mailing list seems very responsive…