Simon Willison’s Weblog

Subscribe
Atom feed for django

565 items tagged “django”

The Django web framework.

2010

Integrate Tornado in Django. A handy ./manage.py runtornado management command for firing up a Tornado server that serves your Django application.

# 8th February 2010, 11:12 am / django, tornado, python

World Government Data. Launched last week, this is the Guardian’s meta-search engine for searching and browsing through data from four different government data sites (with more sites planned). Under the hood it’s Django, Solr, Haystack and the Scrapy crawling library. The application was built by Ben Firshman during an internship over Christmas.

# 27th January 2010, 12:27 pm / django, solr, haystack, scrapy, ben-firshman, guardian, projects, python, data, datagovuk

For the Love of Ponies. Bryan Veloso, the discoverer of the Django Pony, makes contact with the artist who released the original drawing on iStockPhoto.

# 14th January 2010, 12:05 pm / django, python, bryanveloso, djangopony, istockphoto

WildlifeNearYou: It began on a fort...

Back in October 2008, myself and 11 others set out on the first /dev/fort expedition. The idea was simple: gather a dozen geeks, rent a fort, take food and laptops and see what we could build in a week.

[... 558 words]

What’s new in Django 1.2 alpha 1 (via) Multiple database support, improved CSRF prevention, a messages framework (similar to the Rails “flash” feature), model validation, custom e-mail backends, template caching for much faster handling of the include and extends tags, read only fields in the admin, a better if tag and more. Very exciting release.

# 7th January 2010, 7:31 pm / django, python, releases, alpha, csrf

Timing attack in Google Keyczar library. An issue I also need to fix in the proposed Django signing code. If you’re comparing two strings in crypto (e.g. seeing if the provided signature matches the expected signature) you need to use a timing independent string comparison function or you risk leaking information. This kind of thing is exactly why I want an audited signing module in Django rather than leaving developers to figure it out on their own.

# 4th January 2010, 3:23 pm / django, signing, cryptography, keyczar, security, timing-attack, python

Design and code review requested for Django string signing / signed cookies. Do you know your way around web app security and cryptography (in particular signing things using hmac and sha1)? We’d appreciate your help reviewing the usage of these concepts in Django’s proposed string signing and signed cookie implementations.

# 4th January 2010, 1:24 pm / django, python, security, hashing, sha1, hmac, cryptography, codereview

Videos from DjangoCon 2009. The videos from September's DjangoCon are now available, including my "Cowboy development with Django" talk (also on the Internet Archive).

I talked about building Wildlife Near You on a /dev/fort trip to Alderney and the MP's expenses project at the Guardian.

# 3rd January 2010, 11:02 am / django, python, videos, conferences, djangocon, wildlifenearyou, the-guardian

2009

Django | Multiple Databases. Russell just checked in the final patch developed from Alex Gaynor’s Summer of Code project to add multiple database support to Django. I’d link to the 21,000 line changeset but it crashed our Trac, so here’s the documentation instead.

# 22nd December 2009, 5:22 pm / django, multidb, russell-keith-magee, alex-gaynor, python, databases, scaling

Round-robin Django setup with nginx. An nginx trick I didn’t know: a low proxy_connect_timeout value (e.g. 2 seconds) combined with the proxy_next_upstream setting means that if one of your backends breaks a user won’t even see an error, they’ll just have a short delay before getting a response from a working server.

# 21st December 2009, 3:43 pm / django, load-balancing, nginx, ops, sysadmin

Crowdsourced document analysis and MP expenses

Visit Crowdsourced document analysis and MP expenses

As you may have heard, the UK government released a fresh batch of MP expenses documents a week ago on Thursday. I spent that week working with a small team at Guardian HQ to prepare for the release. Here’s what we built:

[... 2,081 words]

Django-Jython 1.1.0 released. Django on Jython matches its minor version numbers to Django, so this new release is compatible with Django 1.1.

# 16th December 2009, 10:42 pm / django, python, jython, leosoto

Guardian iPhone app. Released today, ad-free, £2.39 for the application, has an excellent offline mode. I helped build the backend web service, which is a Django app running on EC2.

# 14th December 2009, 1:29 pm / guardian, ec2, django, iphone, python

Fixing Django Management Commands. Zachary Voase proposes dramatically improving Django’s management command API for Django 1.3. I’m in favour—management commands are one of the only APIs in Django that I have to look up every single time I use. My optfunc library was written partially with management commands in mind—Zachary favours the argparse library.

# 9th December 2009, 8:41 am / django, managementcommands, zachary-voase, argparse, optfunc, python

What’s coming in Django 1.2 (presentation notes). I wrote up some background notes for the talk on Django 1.2 I gave at DJUGL last week.

# 5th December 2009, 5:10 pm / django, python, djugl, speaking

Opening Up Librelist.com Code, Looking For Volunteers. Zed Shaw’s Librelist is a new service for open source project mailing lists, aiming to be donation supported in a similar way to Freenode IRC. The code is all available, and is written in Lamson and Django.

# 4th December 2009, 9:25 am / open-source, mailinglists, librelist, freenode, zed-shaw, lamson, django

Haystack 1.0 Final Released. I’ve used Haystack on a number of projects recently, and it has proved itself as a completely painless way of adding full-text search (using Solr or Whoosh—I haven’t tried the Xapian backend yet) to a Django ORM powered project in just a few minutes. Congratulations, Daniel + contributors.

# 30th November 2009, 8:07 am / django, haystack, daniel-lindsley, search, solr, whoosh, python

Djangopeople JSON parser. Awesome—Andy McKay has compensated for the lack of an official DjangoPeople API by creating a JSONP screen scraped API and hosting it on App Engine. As far as I’m concerned this is an officially supported feature—I’ll make sure future site changes don’t break it, and when I do add an API I’ll try to keep it compatible and help Andy set up redirects.

# 28th November 2009, 11:29 am / django-people, andy-mckay, api, appengine, json, jsonp, django, python

Request Routing With URI Templates in Node.JS. I quite like this approach (though the implementation is a bit “this” heavy for my taste). JavaScript has no equivalent to Python’s raw strings, so regular expression based routing ala Django ends up being a bit uglier in JavaScript. URI template syntax is more appealing.

# 24th November 2009, 9:06 am / uritemplates, javascript, node, python, django, regex

django-batch-select (via) A smart attempt at solving select_related for many-to-many relationships in Django. Add a custom manager to your model and call e.g. Entry.objects.all()[:10].batch_select(“tags”) to execute two queries—one pulling back the first ten entries and another using an “IN” query against the tags table to pull back all of the tags for those entries in one go.

# 23rd November 2009, 4:19 pm / batchselect, django, python, orm, manytomany, sql, selectrelated, john-montgomery

Announcing Kong: A server description and deployment testing tool. An ultra simple website monitoring tool written in Django which makes it easy to manage a list of Twill scripts for testing different sites. It was developed at the Lawrence Journal-World—Eric showed me a demo if this a year or so ago and I’ve been hoping they would open source it.

# 18th November 2009, 12:47 pm / open-source, django, monitoring, ops, eric-holscher, kong

Drupal or Django? A Guide for Decision Makers. A surprisingly interesting comparison—the author describes Django as “a framework with CMS-like tendencies” and Drupal as “a CMS with framework-like tendencies”, then explores the benefits of those two different approaches.

# 15th November 2009, 10:14 pm / drupal, django, frameworks, php, python

Writing good documentation (part 1). Jacob explains some of the philosophy behind Django’s documentation. Topical guides are particularly interesting—many projects skip them (leaving books to fill the gap) but they fill an essential gap between tutorials and low-level reference documentation.

# 11th November 2009, 7:13 am / jacob-kaplan-moss, documentation, django, python

Correct way to handle mobile browsers. If your site has an equivalent “mobile” version running on a different subdomain, how and when should you redirect mobile users to it and how should you let them opt in or opt out?

# 10th November 2009, 8:57 am / mobile, usability, django, eric-holscher, redirect

Django-Jython 1.0.0 released! Now with database backends for PostgreSQL, Oracle and MySQL. The next release (planned for next month) should provide full compatibility with Django 1.1—the current release has 1.1 support for PostgreSQL but only 1.0 support for the other two databases.

# 9th November 2009, 1:53 pm / oracle, mysql, postgresql, django, jython, python, leosoto

Large Problems in Django, Mostly Solved: Search. Eric Holscher shows how Haystack uses a number of common Django patterns (object registration, pluggable backends, QuerySet-style chaining and class-based views) to great effect in creating a powerful search application for Django. Makes me wonder if more of those patterns should be promoted to first class concepts within Django.

# 3rd November 2009, 10:42 am / django, eric-holscher, search, haystack, patterns, classbasedviews, python

Django 1.2 planned features. The votes are in and the plan for Django 1.2 has taken shape - features are split in to high, medium and low priority. There's some really exciting stuff in there - outside of the things I've already talked about, I'm particularly excited about multidb, Model.objects.raw(SQL), the smarter {% if %} tag and class-based generic views.

# 26th October 2009, 10:38 am / django, multidb, python, classbasedviews, orm

Play framework for Java. I’m genuinely impressed by this—it’s a full stack web framework for Java that actually does feel a lot like Django or Rails. Best feature: code changes are automatically detected and reloaded by the development web server, giving you the same save-and-refresh workflow you get in Django (no need to compile and redeploy to try out your latest changes).

# 25th October 2009, 11:21 pm / play, java, frameworks, web, django, rails

Introducing Cloudera Desktop. It’s a GUI for Hadoop, and under the hood is a whole stack of open source software, including Python, Django, MooTools, Twisted, lxml, CherryPy, Mako, Java and AspectJ.

# 21st October 2009, 6:48 pm / hadoop, open-source, cloudera, python, django, mootools, twisted, lxml, cherrypy, mako, java, aspectj

nginx_http_push_module. More clever design with webhooks—here’s an nginx module that provides a comet endpoint URL which will hang until a back end process POSTs to another URL on the same server. This makes it much easier to build asynchronous comet apps using regular synchronous web frameworks such as Django, PHP and Rails.

# 17th October 2009, 4:48 pm / nginx, comet, webhooks, django, php, rails