NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1317 most downloaded on PyPI
A Django app providing DB, form, and REST framework fields for zoneinfo and pytz timezone objects.
Last release 4 months ago
06 Jun 2026
Release timing varies
gaps range from 3 weeks to 1.4 years
Rarely documented
notes for 2 of 29 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
31 releases · first in 2012
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fix Django dependency version spec
Fix Django dependency version spec
Normally this commit would include version number bumps in
Normally this commit would include version number bumps in
however, this time those have already been done.
Facet counts are now shown for applied filters in the admin changelist when toggled on via the UI. This behavior can be changed via the new ModelAdmin.show_facets attribute. For more information see Facets .
Django 5.0 introduces the concept of a field group, and field group templates. This simplifies rendering of the related elements of a Django form field such as its label, widget, help text, and errors.
For example, the template below:
< form > ... < div > {{ form.name.label_tag }} {% if form.name.help_text %} < div class = "helptext" id = " {{ form.name.auto_id }} _helptext" > {{ form.name.help_text | safe }} </ div > {% endif %} {{ form.name.errors }} {{ form.name }} < div class = "row" > < div class = "col" > {{ form.email.label_tag }} {% if form.email.help_text %} < div class = "helptext" id = " {{ form.email.auto_id }} _helptext" > {{ form.email.help_text | safe }} </ div > {% endif %} {{ form.email.errors }} {{ form.email }} </ div > < div class = "col" > {{ form.password.label_tag }} {% if form.password.help_text %} < div class = "helptext" id = " {{ form.password.auto_id }} _helptext" > {{ form.password.help_text | safe }} </ div > {% endif %} {{ form.password.errors }} {{ form.password }} </ div > </ div > </ div > ... </ form >
Can now be simplified to:
< form > ... < div > {{ form.name.as_field_group }} < div class = "row" > < div class = "col" > {{ form.email.as_field_group }} </ div > < div class = "col" > {{ form.password.as_field_group }} </ div > </ div > </ div > ... </ form >
as_field_group() renders fields with the "django/forms/field.html" template by default and can be customized on a per-project, per-field, or per-request basis. See Reusable field group templates .
The new Field.db_default parameter sets a database-computed default value. For example:
from django.db import models from django.db.models.functions import Now , Pi class MyModel ( models . Model ): age = models . IntegerField ( db_default = 18 ) created = models . DateTimeField ( db_default = Now ()) circumference = models . FloatField ( db_default = 2 * Pi ())
The new GeneratedField allows creation of database generated columns. This field can be used on all supported database backends to create a field that is always computed from other fields. For example:
from django.db import models from django.db.models import F class Square ( models . Model ): side = models . IntegerField () area = models . GeneratedField ( expression = F ( "side" ) * F ( "side" ), output_field = models . BigIntegerField (), db_persist = True , )
Field.choices (for model fields) and ChoiceField.choices (for form fields) allow for more flexibility when declaring their values. In previous versions of Django, choices should either be a list of 2-tuples, or an Enumeration types subclass, but the latter required accessing the .choices attribute to provide the values in the expected form:
from django.db import models Medal = models . TextChoices ( "Medal" , "GOLD SILVER BRONZE" ) SPORT_CHOICES = [ ( "Martial Arts" , [( "judo" , "Judo" ), ( "karate" , "Karate" )]), ( "Racket" , [( "badminton" , "Badminton" ), ( "tennis" , "Tennis" )]), ( "unknown" , "Unknown" ), ] class Winner ( models . Model ): name = models . CharField ( ... ) medal = models . CharField ( ... , choices = Medal . choices ) sport = models . CharField ( ... , choices = SPORT_CHOICES )
Django 5.0 adds support for accepting a mapping or a callable instead of an iterable, and also no longer requires .choices to be used directly to expand enumeration types :
from django.db import models Medal = models . TextChoices ( "Medal" , "GOLD SILVER BRONZE" ) SPORT_CHOICES = { # Using a mapping instead of a list of 2-tuples. "Martial Arts" : { "judo" : "Judo" , "karate" : "Karate" }, "Racket" : { "badminton" : "Badminton" , "tennis" : "Tennis" }, "unknown" : "Unknown" , } def get_scores (): return [( i , str ( i )) for i in range ( 10 )] class Winner ( models . Model ): name = models . CharField ( ... ) medal = models . CharField ( ... , choices = Medal ) # Using .choices not required. sport = models . CharField ( ... , choices = SPORT_CHOICES ) score = models . IntegerField ( choices = get_scores ) # A callable is allowed.
Under the hood the provided choices are normalized into a list of 2-tuples as the canonical form whenever the choices value is updated. For more information, please check the model field reference on choices .
The new AdminSite.get_log_entries() method allows customizing the queryset for the site’s listed log entries.
The django.contrib.admin.AllValuesFieldListFilter , ChoicesFieldListFilter , RelatedFieldListFilter , and RelatedOnlyFieldListFilter admin filters now handle multi-valued query parameters.
XRegExp is upgraded from version 3.2.0 to 5.1.1.
The new AdminSite.get_model_admin() method returns an admin class for the given model class.
Properties in ModelAdmin.list_display now support boolean attribute.
jQuery is upgraded from version 3.6.4 to 3.7.1.
The default iteration count for the PBKDF2 password hasher is increased from 600,000 to 720,000.
The new asynchronous functions are now provided, using an a prefix: django.contrib.auth.aauthenticate() , aget_user() , alogin() , alogout() , and aupdate_session_auth_hash() .
AuthenticationMiddleware now adds an HttpRequest.auser() asynchronous method that returns the currently logged-in user.
The new django.contrib.auth.hashers.acheck_password() asynchronous function and AbstractBaseUser.acheck_password() method allow asynchronous checking of user passwords.
QuerySet.prefetch_related() now supports prefetching GenericForeignKey with non-homogeneous set of results.
The new ClosestPoint() function returns a 2-dimensional point on the geometry that is closest to another geometry.
GIS aggregates now support the filter argument.
Support for GDAL 3.7 and GEOS 3.12 is added.
The new GEOSGeometry.equals_identical() method allows point-wise equivalence checking of geometries.
The new MessagesTestMixin.assertMessages() assertion method allows testing messages added to a response .
The new violation_error_code attribute of ExclusionConstraint allows customizing the code of ValidationError raised during model validation .
Under ASGI, http.disconnect events are now handled. This allows views to perform any necessary cleanup if a client disconnects before the response is generated. See Handling disconnects for more details.
The following decorators now support wrapping asynchronous view functions:
cache_control()
never_cache()
no_append_slash()
csrf_exempt()
csrf_protect()
ensure_csrf_cookie()
requires_csrf_token()
sensitive_variables()
sensitive_post_parameters()
gzip_page()
condition()
conditional_page()
etag()
last_modified()
require_http_methods()
require_GET()
require_POST()
require_safe()
vary_on_cookie()
vary_on_headers()
xframe_options_deny()
xframe_options_sameorigin()
xframe_options_exempt()
sensitive_variables() and sensitive_post_parameters() can now be used with asynchronous functions.
File.open() now passes all positional ( *args ) and keyword arguments ( **kwargs ) to Python’s built-in open() .
The new assume_scheme argument for URLField allows specifying a default URL scheme.
In order to improve accessibility, the following changes are made:
Form fields now include the aria-describedby HTML attribute to enable screen readers to associate form fields with their help text.
Invalid form fields now include the aria-invalid="true" HTML attribute.
Support and translations for the Uyghur language are now available.
Serialization of functions decorated with functools.cache() or functools.lru_cache() is now supported without the need to write a custom serializer.
The new create_defaults argument of QuerySet.update_or_create() and QuerySet.aupdate_or_create() methods allows specifying a different field values for the create operation.
The new violation_error_code attribute of BaseConstraint , CheckConstraint , and UniqueConstraint allows customizing the code of ValidationError raised during model validation .
The force_insert argument of Model.save() now allows specifying a tuple of parent classes that must be forced to be inserted.
QuerySet.bulk_create() and QuerySet.abulk_create() methods now set the primary key on each model instance when the update_conflicts parameter is enabled (if the database supports it).
The new UniqueConstraint.nulls_distinct attribute allows customizing the treatment of NULL values on PostgreSQL 15+.
The new aget_object_or_404() and aget_list_or_404() asynchronous shortcuts allow asynchronous getting objects.
The new aprefetch_related_objects() function allows asynchronous prefetching of model instances.
QuerySet.aiterator() now supports previous calls to prefetch_related() .
On MariaDB 10.7+, UUIDField is now created as UUID column rather than CHAR(32) column. See the migration guide above for more details on Migrating existing UUIDField on MariaDB 10.7+ .
Django now supports oracledb version 1.3.2 or higher. Support for cx_Oracle is deprecated as of this release and will be removed in Django 6.0.
The new django.core.paginator.Paginator.error_messages argument allows customizing the error messages raised by Paginator.page() .
The new Signal.asend() and Signal.asend_robust() methods allow asynchronous signal dispatch. Signal receivers may be synchronous or asynchronous, and will be automatically adapted to the correct calling style.
The new escapeseq template filter applies escape to each element of a sequence.
Client and AsyncClient now provide asynchronous methods, using an a prefix: asession() , alogin() , aforce_login() , and alogout() .
AsyncClient now supports the follow parameter.
The new test --durations option allows showing the duration of the slowest tests on Python 3.12+.
The new offset argument of StepValueValidator allows specifying an offset for valid values.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →