June archive

Week(s) in review: June 26

June 26, 2006

Here are the highlights of Django improvements over the past couple of weeks. Lots of great stuff in here...

  • Changeset 3087: Made template names in django.contrib.auth.views passable as template_name argument to the view.
  • Changeset 3091: Added language bidirectional support and updated the admin to use it. The new LANGUAGE_BIDI setting specifies whether a language is right-to-left or left-to-right. Very cool.
  • Changeset 3092: Added a new Manager method, get_or_create(). It does what it says: It tries to look up an object with given parameters, and if it doesn't find one, it creates one. See the docs.
  • Changeset 3094: Made the 'choices' parameter accept any iterable.
  • Changeset 3108: Added support for "and" in template "if" tags. This is something we'd always put off, saying you could just nest "if" statements, but it's a lot nicer to be able to use "and". Example: {% if foo and bar %}. Thanks, ckknight.
  • Changeset 3109: Solved the POST-data-lost-after-redirect problem by raising RuntimeError when DEBUG=True in the CommonMiddleware. Have you ever been bitten by POSTing to a form without a trailing slash, and losing POST data? Be bitten no longer.
  • Changeset 3123: File uploads within the update_object generic view now work. Thanks, parlar.
  • Changeset 3136: Added AllValuesFilterSpec to admin changelist filters, which lets you put any arbitrary field in the "list_filter" option in your "class Admin". For instance, say you have a CharField called "first_name". If you put "first_name" in "list_filter", Django will pull out all available values for that field (doing a SELECT DISTINCT behind the scenes).
  • Changeset 3138: Added 'openbrace' and 'closebrace' options to the {% templatetag %} tag.
  • Changeset 3144: Added HttpResponseNotAllowed, which returns an HTTP status code 405. You pass it a list of permitted methods.
  • Changeset 3145: Models can now be initialized using settable properties. See _set_full_name() in the properties model examples for an example.
  • Changeset 3164: Added a "method" attribute to HttpRequest objects. This is a nicer way of accessing request.META['REQUEST_METHOD'].upper().
  • Changeset 3165: The template system now accepts generators in "for" loops. Thanks, dbm-django@mclachlan.com.au.
  • Changeset 3166: Improved HttpResponseRedirect and HttpResponsePermanentRedirect to percent-encode non-ASCII characters in the Location header. Thanks, Andrey.
  • Changeset 3174: Added manage.py "runfcgi" option, along with the new FastCGI documentation. Thanks, jcrasta@gmail.com and others.
  • Changeset 3185: Added an optional comparison argument to the "timesince" template filter. Also added a "timeuntil" filter that works the same way. Thanks, john@sneeu.com.
  • Changeset 3134: Added generic foreign-key support. This excellent feature lets you relate an object to "any" object, through content-type and ID fields. A trendy example: Tagging. See the example models for use.

In other Django news:

Official FastCGI docs

June 26, 2006

Can't (or don't want to) use Django with mod_python? Check out our new document, How to use Django with FastCGI. We provide instructions for both Apache and lighttpd.

Thanks to all of the people who contributed to this document!

Tabblo hits the mainstream

June 21, 2006

Congrats to Django-powered Tabblo.com, covered today in Walt Mossberg's highly respected Wall Street Journal column. Tabblo has hit the big time!

Here's a writeup from the Tabblo team. We hope to publish an interview with some Tabblo folks in the coming month or so.

Evansville Courier-Press site relaunched, Django-style

June 15, 2006

Congrats to courierpress.com, the Web site of the Evansville, Ind., Courier & Press newspaper, for converting its site to Django. It looks great and has gotten quite a bit of industry buzz since it launched a couple of days ago.

Industry weblog Lost Remote says "it's unlike any newspaper-based site you've probably seen."

Here are some notes from Scripps dude Jay Small.

Because the Scripps company has moved its Web development to the Django platform, the coming year will bring many more Django-powered sites. Great stuff.

Django is hot

June 7, 2006

Whew! It's been a great 24 hours. The IBM Developer Works article made it to Digg, where it quickly rose to the Digg home page. 406 diggs and counting! (Whoop, make that 407...)

The article also made it to del.icio.us popular, a great indicator of what's hot.

Thanks to everybody for digging and bookmarking!

I can't help but share some choice quotes from the Digg page...

  • DeadWisdom: "PHP is like grunting and hand signals to Django's eloquent prose."
  • trutwin: "A great project - the only framework I've tried and actually used."
  • infradead: "Django totally rocks, and I'm saying that as someone who hadn't programmed either Django or Python until about four weeks ago. I'm creating some new web-based apps for work, and also (I hope) about to pick up some freelance work based on pitching Django to the client. It's ridiculously easy to use, and suitable for non-hardcore programmers."
  • glenn1you0: "Django is a frame work that gives you a head start on most apps for which you'd use it. If you have to run a race, django lets you start at the half-way point. Everything up to that point is just calisthenics."

IBM Developer Works article

June 6, 2006

IBM Developer Works has posted an article about Django:

In this first article of a two-part series, we show off Django, an open-source model-view-controller (MVC)-style Web application framework powered by the Python programming language. With Django, you can create high-quality, easy-to-maintain, database-driven Web applications in minutes.

Digg it.

Week in review: June 5

June 5, 2006

Here are the highlights of Django improvements this past week (technically the past couple of days, because last week's report went over):

  • Changeset 3047: Fixed PostgreSQL index introspection in tables that have dropped columns. Thanks, Chris Chamberlin.
  • Changeset 3048: A TypeError was being thrown if a form doesn't have the correct enctype for uploading files. Django now throws a ValidationError, as it should.
  • Changeset 3049: Added a SESSION_EXPIRE_AT_BROWSER_CLOSE setting, which regulates whether the session framework should use browser-session-length cookies. See the new docs.
  • Changeset 3050: Added a pretty "Unknown" icon to use in admin-site changelists for NullBooleanFields.
  • Changeset 3051: Lengthened form labels on the admin login screen to accommodate other languages, which might have longer words.
  • Changeset 3055: Added YEAR_MONTH_FORMAT and MONTH_DAY_FORMAT settings, and added technical message IDs of the same names. Thanks, ramiro. This lets i18n users customize the way dates are displayed in the admin site when you're using the date_hierarchy option.
  • Changeset 3058: Changed AuthenticationForm to disallow users with is_active=False from logging in. Thanks, dave@rightround.com and germish@gmail.com.
  • Changeset 3071: Added 'page' parameter to the object_list generic view. Thanks, kanashii@kanashii.ca. See the new docs.
  • Changeset 3073: Added a 'search' DB-API lookup type, which does full-text index searches in MySQL. See the new docs.
  • Changeset 3076: Added django.contrib.humanize, a set of template tags for adding a 'human touch' to data. They do helpful things such as converting numbers to their ordinal equivalents (e.g. '2' to '2nd') and adding commas to big numbers (e.g. '1000' to '1,000'). See the new docs.

In other Django news:

Week in review: May 31

June 1, 2006

Here are the highlights of Django improvements this past week-and-a-half-ish (the Memorial Day weekend in the U.S. delayed this week's entry):

  • Changeset 2970: Fixed bug with Meta.ordering being ignored when slicing a single item off a QuerySet. Thanks, Gábor Fawkes.
  • Changeset 2981: Changed comments.py views to use relative URL for redirects. Thanks, phil@produxion.net.
  • Changeset 2984: Changed django.core.mail to include 'Date' header in e-mails. Thanks, Eric Walstad.
  • Changeset 2985: Initial SQL data now works in SQLite if there are multiple statements. Thanks, jpellerin@gmail.com.
  • Changeset 2990: Base handler no longer calls mail_admins() on SystemExit, in case of forked processes called from views. Thanks, Hugo.
  • Changeset 2991: The 'add' green plus sign no longer appears in admin change forms for fields whose related models don't have an admin.
  • Changeset 2992: Made negative indexing on QuerySet instances raise an assertion error (previously it just returned incorrect results).
  • Changeset 2993: Every database backend now properly raises ImproperlyConfigured if the relevant Python database module raises ImportError. This should help avoid some newbie confusion.
  • Changeset 2994: Improved error message if DATABASE_ENGINE is invalid. This should also help avoid some newbie confusion.
  • Changeset 2995: AttributeErrors in models are no longer ignored by the model validator.
  • Changeset 2997: Fixed bug with QuerySet.exclude() failing to do negations on Q objects, and at the same time generalised exclude/QNot so that they work for 'external' Q objects, i.e. ones that simply have 'get_sql' defined.
  • Changeset 2999: Models are now sorted by verbose_name_plural in the admin index page. Thanks, Alex Dedul.
  • Changeset 3002: auto_now_add fields now work properly when saving multiple times.
  • Changeset 3004: Improved Atom feed framework by outputting "rel=alternate". Thanks, Ned Batchelder.
  • Changeset 3009: 'View on site' now works with non-integer primary keys.
  • Changeset 3012: Added support to the Django auth mod_python handler (django/contrib/auth/handlers/modpython.py) for setting DJANGO_SETTINGS_MODULE via a PythonOption instead of SetEnv.
  • Changeset 3014: get_object_or_404 now allows *args as well. Thanks, Joeboy.
  • Changeset 3018: Fixed raw_id_admin display in admin. Thanks, Christopher Lenz.
  • Changeset 3019: QuerySet._combine now combines where clause. Thanks, graham@darkcoding.net.
  • Changeset 3020: autoreload.py no longer fails for uninstalled 'thread' module. Thanks, plmeister@gmail.com.
  • Changeset 3021: Ooption values are now escaped in SelectMultipleField.
  • Changeset 3022: Added 'mimetype' parameter to generic views. Thanks, Ian Holsman.
  • Changeset 3023: Admin now quotes strings in breadcrumbs and filters. Thanks, mhf@hex.no.
  • Changeset 3024: Fixed bug in admin where it would redirect infinitely if invalid lookup parameters were given in the URL.
  • Changeset 3026: Made isValidEmail validator wider in scope. Thanks, mir@noris.de.
  • Changeset 3034: Escaped history messages in admin. Thanks, SmileyChris.
  • Changeset 3038: The CursorDebugWrapper now supports pyformat paramstyle.
  • Changeset 3039: Added a make_object_list parameter to the archive_year date-based generic view. Thanks, jhf@hex.no.
  • Changeset 3040: Added first_on_page() and last_on_page() methods to ObjectPaginator. Thanks, m@bagai.com.
  • Changeset 3044: Improved DB API quote_only_if_word() so that it doesn't quote 'select' parameters that are not all word characters. Thanks, dja@cdc.msbx.net.
  • Changeset 3045: Fixed some threading issues for FreeBSD. Thanks, scott@clued-in.co.uk.

In other Django news: