Dictionary lookup removed for request object in Django 1.0 and other fun facts.
For one thing django.core.validators, which I was using, was removed. The fix: copy it back from the earlier version.
Not sure if it was a bad practice or not but I was also doing dictionary lookups on the request object and that's been removed now.
The errors you will get are:
- 'WSGIRequest' object is not iterable
- 'WSGIRequest' object is unsubscriptable
If you're in the same boat, here's the regular expressions you need to find/replace in TextMate:
Fix 'WSGIRequest' object is not iterable:
Find:
' in request(?!\.)
Replace:
' in request.REQUEST
'WSGIRequest' object is unsubscriptable:
Find:
request\['
Replace:
request.REQUEST['
Also, I switched from using Google App Engine Helper for Django to app-engine-patch. The main reason? So I could have the sessions middleware and run the PyAMF Shell. (And, of course, it's good to be running Django 1.0 now.)
App-engine-patch supports Django's mail feature so I stopped using google.appengine.api.mail.EmailMessage and replaced it with django.core.mail.EmailMessage. One thing to note if you do this is that you need to change the to properties on your EmailMessage instances to be lists, not strings, lest you end up trying to email each letter in the email address separately.
(Also, on my local server, I keep getting a Broken Pipe (error 32) since I upgraded to Django 1.0. I set fail_silently to True on my send() calls and that's fixed it. I don't have any issues on the deployment server. Looking into that one but it's a hairy one to track down.)
The Dictionary lookup removed for request object in Django 1.0 and other fun facts. article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.

Subscribe to my blog






James Bennett
Yeah, looks like we missed that one in the porting guide. I’ve added a new section to the guide covering this, and it should show up in the online version in a few minutes when the documentation rebuild finishes.
October 5th, 2008 at 5:06 pm