Pull requests

#15 Merged
Repository
glic3rinu/django-admin-tools-fixes django-admin-tools-fixes
Branch
default
Repository
izi/django-admin-tools django-admin-tools
Branch
default

Fixes compatibility with Django 1.5

Author
  1. glic3rinu
Reviewers
Description

1. Adds compatibility with swappable User model ##

New Django 1.5 feature that allows to configure a custom User model for contrib.auth application.

See release notes https://docs.djangoproject.com/en/dev/releases/1.5/#configurable-user-model

2. Fixes url template tags

admin-tools breaks in Django 1.5 because it requires view names in url template tags to be strings (syntax available since 1.4) Additional info from django 1.5 release notes:

One deprecated feature worth noting is the shift to “new-style” url tag. Prior to Django 1.3, syntax like {% url myview %} was interpreted incorrectly (Django considered "myview" to be a literal name of a view, not a template variable named myview). Django 1.3 and above introduced the {% load url from future %} syntax to bring in the corrected behavior where myview was seen as a variable.

The upshot of this is that if you are not using {% load url from future %} in your templates, you’ll need to change tags like {% url myview %} to {% url "myview" %}. If you were using {% load url from future %} you can simply remove that line under Django 1.5

This patch maintains backward compatibility with previous versions of Django.

  • Learn about pull requests

Comments (6)