What’s New in
Django 1.5
Marc Tamlyn
Wednesday, 13 March 13
Slide 2
Slide 2 text
Major Changes
• Pluggable User models
• Python 3
• Security Improvements
• StreamingHTTPResponse
• {% url %} tag
• ... and much more
Wednesday, 13 March 13
Slide 3
Slide 3 text
Pluggable User Model
• Does what it says on the tin!
• Solution to schema changes on the
default user model
• AUTH_PROFILE_MODEL becomes
AUTH_USER_MODEL
Wednesday, 13 March 13
Slide 4
Slide 4 text
Pluggable User Model
• auth.models.AbstractUser
• auth.models.PermissionsMixin and
auth.models.AbstractBaseUser
• USERNAME_FIELD
• contrib.admin integration
• External apps
Wednesday, 13 March 13
Slide 5
Slide 5 text
Python 3
• Python 3.2 and 3.3 supported
• Not yet “production ready”
• Upgrade your third party apps!
• Caveats: MySQL, PIL, Selenium (etc.)
• (Python 2.5 gone)
Wednesday, 13 March 13
Slide 6
Slide 6 text
Security
• ALLOWED_HOSTS
• Backported to 1.3.X and 1.4.X, but
required in 1.5
• Yes it’s boring
Wednesday, 13 March 13
Slide 7
Slide 7 text
StreamingHTTPResponse
• Fixes the handling of streaming
responses
• streaming_content instead of content
Wednesday, 13 March 13
Slide 8
Slide 8 text
{% url %}
• Fixed in 1.3 with load from future
• Old style actually gone now
• If you’ve not been using it, the first
thing you’ll notice breaking!
Wednesday, 13 March 13
Slide 9
Slide 9 text
More New Things
• Caching of related model instances
• update_fields
• PostGIS 2.0
• {% verbatim %}
Wednesday, 13 March 13
Slide 10
Slide 10 text
Backwards
Incompatibilities
• Context in various class based views
• simplejson
• Session not saved on 500
• Testing:
- OPTIONS, PUT and DELETE
- DB flushing
- No sequence reset
- Ordering of test execution changed
Wednesday, 13 March 13
Slide 11
Slide 11 text
Deprecations
• contrib.localflavor
• contrib.markup
• manage.py cleanup
• depth argument to select_related
Wednesday, 13 March 13
Slide 12
Slide 12 text
Nice things you may
have missed
• LOGIN_URL can be a url name
• True, False and None in templates
• OPTIONS requests to CBVs
• user_login_failed signal
• assertXMLEqual()
• index_together
Wednesday, 13 March 13
Slide 13
Slide 13 text
Nice things you may
have missed
• Admin list filters customisable by
request
• cleaned_data on invalid forms
• django.utils.text.slugify
Wednesday, 13 March 13
Slide 14
Slide 14 text
Want to know best
practice?
Wednesday, 13 March 13