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.
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 %}
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”
Looks like you need to have both blank=True and null=True to make a ForeignKey optional in a django model…
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)
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…