Weblog

Weeks in review: Aug. 22

Here are the highlights of Django improvements over the past few weeks (since version 0.95 was released). Aside from many small tweaks, bug fixes and usability improvements, here are some substantial new improvements in the Django development version:

  • Changeset 3520: No more need to edit MD5 or SHA hashes when creating users via the Django admin site! We've created a special-case 'Add user' admin view.
  • Changeset 3554: URLconfs can be passed callable objects as an alternative to strings. See the new documentation.
  • Changeset 3570: Added a SESSION_COOKIE_SECURE setting. If it's set to True, your session cookies will use the "secure" flag.
  • Changeset 3601: Added some cool new operators for the Admin "search_fields" parameter, so you can specify, for instance, that the search match only against the beginning of the database column, for performance. See the new search_fields documentation.
  • Changeset 3602: Added a middleware class called SetRemoteAddrFromForwardedFor. It's useful if you're behind a reverse proxy and want to convert the HTTP_X_FORWARDED_FOR header to REMOTE_ADDR automatically. See the new SetRemoteAddrFromForwardedFor documentation.
  • We've added a How to read the Django documentation document. (Yes, this is documentation about documentation. Rest assured we have no plans to write a document about how to read the document about documentation.)
  • We've created a 0.90-bugfixes branch and a 0.91-bugfixes branch. They're for people stuck on older releases of Django who can't immediately upgrade but run into bugs that have been fixed in the newest version but hadn't been backported. James Bennett is maintaining these branches, checking in bug fixes as they come up.

Posted by Adrian Holovaty on August 22, 2006

Comments

Espen August 22, 2006 at 11:30 a.m.

You should post some information on the summer of code projects also soon since the projects where due yesterday. We are all really excited to hear how it all turned out.

Adrian Holovaty August 22, 2006 at 12:26 p.m.

Great idea, Espen. We'll put something together.

Adam August 22, 2006 at 12:42 p.m.

I just have to say that I love the URL for the meta-documentation.

Mike August 22, 2006 at 12:48 p.m.

On (Changeset 3554), doesn't it make it slower to load all modules on every request, as apposed to loading each as needed?

Awesome work overall.

Adrian Holovaty August 22, 2006 at 1:34 p.m.

Mike: If you pass callable objects to your URLconfs, clearly you'll have to import those objects from somewhere before you pass them -- so, yes, there will be more of a start-up cost. (The "old" way of passing strings rather than objects is unaffected by this change.)

In the grand scheme of things, this isn't a huge deal, though. All of your views are going to be loaded eventually anyway -- putting off the import is just delaying the inevitable. :)

Xavier August 23, 2006 at 4:10 p.m.

I am new to Python and especially to Django, so please forgive what might be an ignorant question.

Does anything like Mongrel (http://mongrel.rubyforge.org/) exist for Python (Django)?

Thanks in advance.

fRzzy August 23, 2006 at 4:45 p.m.

Django has its own webserver embedded for developing, you can start it with manage.py script (http://www.djangoproject.com/document...) just like RoR has its own modified(?) version of WEBrick.

For production sites, Django has two ways to deploying apps, use mod_python or FastCGI, both can be used with an Apache installation.

Xavier August 24, 2006 at 8 a.m.

fRzzy:

Mongrel works by allowing someone to proxy web request over many Mongrel instances. These Mongrel instances could also be running on multiple machine, hence easily allowing anyone to load balance their web traffic.

Since mod_python is embedded in Apache, I'm assuming you can't load balance the same way Mongrel works. I'm not so sure about FCGI if you are able to do that.

Does such functionality exist in Python (or Django) to forward/proxy request to "helper" instances to processes the request (load balance).

bshi August 24, 2006 at 12:05 p.m.

Xavier - maybe this document might help?

http://code.djangoproject.com/wiki/Lo...

Xavier August 25, 2006 at 12:15 a.m.

So, it sounds like I can use lighttpd + flup to accomplish easy load balancing with python (django).

xyz August 25, 2006 at 12:29 a.m.

So, how is the django book coming? Can we expect to see any chapters online soon?

Jason August 28, 2006 at 12:46 p.m.

I've had Pound (http://www.apsis.ch/pound) recommended for TurboGears load balancing. Don't see why it wouldn't work for Django.

fRzzy August 28, 2006 at 8:35 p.m.

Xavier: Mongrel works the same way as any web server, you can have multiple instance of you Django app on several servers and use a load balancer to distribute load between them.

You can use a hardware-based load balancer or a software=based one (like Pound) or simple setup a round robin DNS. They can all do the job.

Comments are closed

To prevent spam, comments are no longer allowed after sixty days.