This article was originally published in the wechat public account “Geek Monkey”, welcome to follow the first time to get more original sharing

Software development teams regularly release new versions of high-profile software that many people are using. The main purpose is to fix some old bugs and add some new features. Django, as the mainstream Python Web development framework, is no exception. A few days ago, on August 1, the Official Django team released Django version 2.1.

New release, we can not rush to update and replace, but to pay attention to the new release content. I took a look at the official announcement and summarized a few important points.

1 Supported by Python

Django 2.1 will no longer support Python 3.4, with a minimum Python version of 3.5 required. This also means that Django 2.0 is the last version to support Python 3.4.

2 Add view rights to the model

This is a feature that many developers have been waiting for. Looking for the stars and looking for the moon.

In previous versions, models had only add, delete, and modify permissions. New version Adds the View permission. This also means that in the Model’s Meta configuration options, the default_permissions attribute defaults to (‘add’, ‘change’, ‘delete’, ‘view’).

In addition, the official team considered forward compatibility. In older versions, if the user has the change permission. Update to the new version, users will automatically get View permission.

View permissions also apply to admin, which can assign read-only permissions to the user. This is set with modeladmin.has_view_permission (request, obj=None). If you want an obj to be read-only, return True.

3 model

The new version of the Model class also has some features, and I’ve listed some of the more important ones.

  • Model Model classes support init_subclass overwriting
  • Query expressions finally support negative sign queries.
  • In the form of the model, BinaryField can be set to Editable =True.

4 the form

Add the Accept =”image/*” attribute to the ImageField component in Forms.

5 the cache

Local-memory cache Backend uses the least recently used (LRU) filter policy to replace the previous random number policy.

6 Supported database versions

  • Django 2.1, the MySQL database, no longer supports MySQL 5.5 or later, but only 5.6 or later.

  • The PostgreSQL database Django 2.1 supports PostgreSQL as late as 9.4.

  • SQLite < 3.7.15 is no longer supported by the new version of SQLite database.


Django version 2.1 has arrived. Welcome to reprint the article at any time, reprint please contact number to open the white list, respect the author’s original. I use my wechat account “Geek Monkey” to share original Python works every week. Related to web crawler, data analysis, Web development and other directions.