Weblog

December archive

Week in review

December 18, 2005

This week was devoted to hard work on the magic-removal branch, which makes several sweeping changes to the Django codebase. Most changes involve the database API and removing some of its unneeded magic, which confuses newbies and has a few warts. The goal is to get the magic-removal branch integrated into trunk by the end of the year.

Of course, you can try out the branch for yourself at any point; see Using branches to learn how to do this. Be warned, though, that the magic-removal code is under heavy development!

In other Django news:

Week in review

December 11, 2005

Here are the highlights of Django improvements this week, in chronological order.

  • Revision 1548 -- Changed CommonMiddleware so it doesn't assume HTTP_HOST is set.
  • Revision 1550 -- Fixed bug in get_next_by_FOO/get_previous_by_FOO methods that caused a database error when using those methods along with joining lookup contraints.
  • Revision 1551 -- Improved django.contrib.admin.views.main to raise ImproperlyConfigured if admin app isn't in INSTALLED_APPS. This avoids one possibility of an obscure error.
  • Revision 1556 -- Added conf/project_template/manage.py, which is a light wrapper around django-admin.py that gets installed in each project with 'startproject'. It takes care of the PYTHONPATH and DJANGO_SETTINGS_MODULE business automatically. More on this soon.
  • Revision 1565 -- Added an 'It worked' page, in a empty_urlconf() view in views/debug.py. It's called if the URLconf is empty. More on this soon.
  • Revision 1566 -- Fixed a bug in the admin when deleting models with a OneToOneField. Thanks, Eric Moritz.
  • Revision 1569 -- Fixed a bug in saving objects with non-integer primary keys.
  • Revision 1571 -- Fixed a bug in archive_month generic view leaving out the last day of the month. Thanks, ubernostrum.
  • Revision 1575 -- The admin now selects a single choice for ForeignKey fields if only one choice is available. Thanks for reporting, Eugene.
  • Revision 1577 -- Fixed an error when using ChangeManipulator in a model with raw_id_admin on a ForeignKey. Thanks, Gustavo Picon.
  • Revision 1578 -- Fixed an edge-case bug in the debug view for templates that have only one line. Thanks, andy at jadedplanet.
  • Revision 1579 -- Fixed the timesince() utility. Thanks, pgross at ThoughtWorks.
  • Revision 1580 -- The admin-site JavaScript shortcut for raw_id_admin on ManyToManyFields no longer replaces existing values.
  • Revision 1581 -- The 'tables' parameter in the DB API is now only quoted if needed. Thanks, Russell Keith-Magee.
  • Revision 1582 -- Fixed an exception-handling bug in defaulttags SsiNode. Thanks, Henryk on IRC.
  • Revision 1583 -- CREATE TABLE SQL in Postgres now quotes column name in 'CHECK' clause. Thanks, exoweb adrian.
  • Revision 1584 -- Changed default session cookie name from hotclub to sessionid. See the weblog entry..

In other Django news:

  • A couple of more Django jobs have been announced: work with Jacob in Kansas, or work with Antonio Rodriguez (antonio at bitscrap dot com) on a stealth startup in Boston.
  • There was quite a bit of discussion on the django-developers mailing list about cutting out unnecessary magic in Django's database API. We've started a "magic-removal" branch that focuses on removing the magic. See the RemovingTheMagic wiki page for information.
  • "Well, in about 2 hours, I got my whole thing moved over to the Django framework and working much better than before."
  • "Django is a framework that allows for the rapid development of highly interactive websites. The results are stunning and sublime."

Django: Now 10% less pornish

December 11, 2005

We've changed the default session cookie name. Instead of "hotclub", it's now "sessionid". Intended as a reference to the Hot Club of France (one of Django Reinhardt's bands), "hotclub" had been misinterpreted by some people as having some sort of porn-site meaning.

Oh, well. Wit and obscure references only go so far.

Django in use at washingtonpost.com

December 8, 2005

We've launched the first Django app at washingtonpost.com. The U.S. Congress Votes Database lets you browse every vote in the U.S. Congress since 1991.

Django powers the entire votes site, including the RSS feeds for every member of Congress. The database has more than four million records.

The site was linked-to from the washingtonpost.com home page today during the site's highest-traffic time (9 a.m. to noon), and it didn't break a sweat.

Now may be a good time to point out that performance was specifically one of Django's core design requirements. We Django devs have done some informal benchmarks of Django with other dynamic-language Web frameworks, and we're consistently astounded by how much faster each level of the Django stack is -- from the URL mapper to the database layer to the template system.

Week in review

December 4, 2005

Here are the highlights of Django improvements this week, in chronological order.

  • Revision 1480 -- Added a how to contribute to Django document.
  • Revision 1484 -- Added 'django-admin.py inspectdb' support for SQLite. Thanks, Swaroop.
  • Revision 1489 -- Many-to-many raw_id_admin change page now displays original object(s) correctly. Thanks for reporting, mordaha.
  • Revisions 1495 and 1500 -- Added an Apache authentication handler, so you can tell Apache's authentication machinery to use a Django users database. See the new docs.
  • Revision 1504 -- Changed behavior of QueryDict.items() to be more consistent, fixed mutability holes, gave MultiValueDict many more dictionary methods and added unit tests. Thanks, Kieran Holland. This is slightly backwards-incompatible if you happened to rely on the behavior of QueryDict.items(), which is highly unlikely.
  • Revision 1508 -- Added "OR" support to the database API. See the weblog entry.
  • Revision 1510 -- Added an "allow_empty" hook to the archive_index date-based generic view.
  • Revision 1511 -- Manually-set AutoField values are now respected. Thanks, cygnus.
  • Revision 1513 -- Improved the model validator to throw an error if a model has two ManyToMany relationships to the same model and doesn't set 'singular'.
  • Revision 1516 -- Fixed a bug in the generated DB API for models that have two ManyToManyFields to the same related model.
  • Revision 1517 -- 'django-admin.py sqlsequencereset' now includes the many-to-many join tables. Thanks for reporting, exoweb adrian.
  • Revision 1518 -- "django-admin.py inspectdb" for SQLite now introspects field types. Previously, it used TextField for everything.
  • Revision 1519 -- FileFields now work in the create_update generic view. Thanks, limodou.
  • Revision 1520 -- Added a helpful error message if there's a problem in running the Django unit tests. Thanks, paolo.
  • Revision 1521 -- The admin 'change password' and 'log out' links no longer assume the admin lives at '/admin/'. Thanks, deric at monowerks.
  • Revision 1522 -- The admin bookmarklets no longer assume admin is rooted at '/'.
  • Revision 1526 -- Made 'django-admin.py --help' output easier to read. Thanks, Oliver.
  • Various revisions -- Added support for translation (gettext, etc.) in JavaScript files. See the new docs.
  • Revision 1547 -- Added "__ne__()" support for Django models, which apparently wasn't working on Python 2.3 (?). Thanks, GomoX.

In other Django news:

Snakes and Rubies conference recap

December 4, 2005

Jacob, Simon and I met in Chicago this weekend for the Snakes and Rubies conference, where I presented Django and David Heinemeier Hansson presented Ruby on Rails.

Turnout was fantastic: More than 100 people showed up and packed themselves into a standing-room-only meeting room at DePaul University.

The Django presentation went quite well, and lots of attendees who hadn't yet tried Django said they were intrigued by the framework and wanted to give it a try. Django even got plenty of kind comments from the Ruby folks, including David himself, who said he'd probably be using Django if he hadn't written Rails. We hope at least some of the Ruby folk will check out Django as a fine competitor to Rails (and Python as a saner Ruby).

A theme to which we returned several times during the event was the similarity between the two frameworks. They certainly have more in common than not, and common "enemies" -- PHP, Java, Perl -- and common philosophies -- beauty, cleanliness, perfectionism -- unite the communities even more.

Still, the frameworks clearly have different opinions on what they should and shouldn't do. For example, David said he has no plans to offer internationalization, an RSS framework, or an admin interface, in Rails proper, because he sees those as outside the scope of the project. Yet Rails includes an Ajax framework, which, one could argue, is just as "high-level" as RSS or internationalization. Django, on the other hand, includes these things but doesn't include an Ajax library (yet). The differences, and well-argued justifications, are fascinating to think about.

Jacob is working on editing video and audio of the presentations, and we're hoping to Web-post those on this site later this week. In the meantime, check out some blog coverage of the event (in no particular order):