Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A Django app to help for Django upgrades.

Project Description

Collection of code/tools to help for Django upgrading. This package name is a reference to python package ‘six’ which was helping compatibility between python 2 and 3.

The idea of this package is to share some experience gained from a Django upgrade from 1.4 to 1.9 on a quite big project. Have a look at Django Upgrade talk for more details. django-seven will at the beginning contain compat module and deprecated rules logic.

Deprecated rules

A Django management command check_deprecated_rules is available to check if your project is “upgrade-compatible”.

You should first add django_seven.deprecated_rules to your INSTALLED_APPS:


Then you should define your current Django version and the version you want to upgrade to in your settings file:


Then launch the check_deprecated_rules management command for your project:

$ ./ check_deprecated_rules

1601: models.BooleanField has to be initialised with default parameter,
      as implicit default has changed between Django 1.4 (False) and 1.6 (None).
L6:     boolean_field = models.BooleanField()

This command will give you a list of non-respected rules, with useful informations to fix them:

  • The impacted file,
  • The rule number, with an explanation of the rule,
  • The line number, and the line copy.

By default, django-seven is defining some deprecated rules, but you can also define yours in settings file. You should respect the rule fields:

        'name': 'deprecated_django_local_flavor_module',
        'message': 'Deprecated django.contrib.localflavor module (now third-party lib). Use localflavor instead.',
        'regex': r'.*django\.contrib\.localflavor.*',
        'number': '1602',
        'should_be_fixed_in': '1.6',

You can also use the django-seven ones and add yours:

    # Your custom rules

from django_seven.deprecated_rules.rules import DEPRECATED_RULES as SV_DEPRECATED_RULES

You can specify through settings which directories/files you want to exclude from the deprecated rules search:

SEVEN_EXCLUDED_DIRS = ['venv', '.git', 'frontend', 'static', 'docs']


Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_seven-0.1.1.tar.gz (15.7 kB) Copy SHA256 Checksum SHA256 Source Jul 26, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting