1.3.7

Latest release in branch 1.3
Released 13 years ago (February 20, 2013)

Software Django
Branch 1.3
Status
End of life
End of mainstream support March 23, 2012
End of extended support February 26, 2013
First official release version 1.3
First official release date 15 years ago (March 23, 2011)
Supported
Python versions
Python 2.4 - 2.7
Release notes https://docs.djangoproject.com/en/1.11/releases/1.3/
Source code https://github.com/django/django/tree/1.3.7
Django 1.3 Releases View full list

What Is New in Django 1.3

Django 1.3 introduces several major features that streamline development workflows and enhance application capabilities. The most significant additions include class-based views, a framework for writing logging-based code, and support for static files. This release also lays the groundwork for future database schema migrations.

Category Key Changes
New Features Class-Based Views, Logging, Static Files Handling, Unittest2 Support
Improvements Transaction Management, Configurable Delete Cascade, Template Rendering
Backwards Incompatible Changes CSRF Validation, Email Field Length, Custom SQL Loading
Deprecated Features TEST_RUNNER setting, 'required' attribute on form fields

How do class-based views change Django development?

Class-based views provide a powerful way to structure view logic using inheritance and mixins. Instead of writing function-based views for everything, you can now extend generic views like ListView or DetailView to handle common patterns. This approach reduces boilerplate code and makes view logic more organized and reusable across projects.

In practice, you can create a list view for your model with minimal code:

from django.views.generic import ListView
from myapp.models import Article

class ArticleListView(ListView):
    model = Article
    template_name = 'article_list.html'
    context_object_name = 'articles'

What improvements were made to static files handling?

Django 1.3 finally includes built-in support for managing static files like CSS, JavaScript, and images. The new staticfiles app provides the {% static %} template tag and a development server for serving these assets. This eliminates the need for third-party apps or manual configuration in most cases.

The framework introduces three new settings: STATIC_ROOT, STATIC_URL, and STATICFILES_DIRS. You can now run python manage.py collectstatic to gather all static files from your apps into a single directory for production deployment.

How does the new logging configuration work?

Django 1.3 integrates with Python's logging module, providing a consistent way to configure application logging through the LOGGING setting. This replaces the older, more limited DEBUG and manual logging approaches with a proper logging framework.

You can now configure handlers, formatters, and loggers in your settings file just like in standard Python applications. This matters because it gives developers fine-grained control over what gets logged and where it goes - whether to files, email admins, or other destinations.

What database transaction changes were introduced?

The transaction handling got a significant upgrade with the introduction of transaction control per view. You can now use the @transaction.commit_on_success decorator on view functions to wrap the entire request in a transaction. If the view returns successfully, the transaction commits; if it raises an exception, the transaction rolls back.

This approach simplifies database consistency management, especially for complex views that make multiple database changes. It's much cleaner than manually managing transaction boundaries throughout your view code.

What are the notable backwards incompatible changes?

Several changes might break existing applications when upgrading. The CSRF protection mechanism was strengthened and now requires the {% csrf_token %} tag in all forms using POST. The EmailField now defaults to 254 characters instead of 75 to accommodate longer email addresses.

Custom SQL loading from the sql/ directory was deprecated in favor of database migrations. The TEST_RUNNER setting default changed to use the new unittest2 compatible runner, which might affect custom test suites.

FAQ

How do I start using class-based views in my existing project?
Begin by converting simple views first. Replace function-based views that display object lists or details with ListView and DetailView subclasses. The documentation provides a clear mapping from old patterns to new class-based approaches.

Does the static files app work with existing third-party static file solutions?
You'll likely want to migrate to the built-in solution. The new staticfiles framework is designed to be a standard replacement. Remove third-party apps like django-staticfiles or django-compressor and reconfigure your settings using STATIC_ROOT and STATIC_URL.

What happens to my existing logging configuration after upgrading?
If you were using custom logging, you'll need to convert it to the new LOGGING dictionary format. The old ad-hoc logging approaches will continue to work but the new system provides more flexibility and follows Python standard practices.

Are there any performance implications with the new transaction handling?
Wrapping entire views in transactions might slightly increase database connection time for simple views. For read-heavy views, you can use the @transaction.commit_manually decorator or the @transaction.autocommit decorator to optimize performance where full transactions aren't needed.

How do I handle the CSRF protection changes that break my forms?
You must add {% csrf_token %} inside all your <form> elements that use POST. If you have AJAX requests, you'll need to modify them to include the CSRF token in the request headers or data. The release notes provide detailed examples for both scenarios.

Releases In Branch 1.3

Version Release date
1.3.7 13 years ago
(February 20, 2013)
1.3.6 13 years ago
(February 19, 2013)
1.3.5 13 years ago
(December 10, 2012)
1.3.4 13 years ago
(October 17, 2012)
1.3.3 13 years ago
(August 01, 2012)
1.3.2 13 years ago
(July 30, 2012)
1.3.1 14 years ago
(September 10, 2011)
1.3 15 years ago
(March 23, 2011)