Repository: cookiecutter/cookiecutter-django

Issue:
[Update Django] Django 3.2
3.2 requirements tables



## base.txt

| Name | Version in Master | 3.2 Compatible Version | OK |
| ---- | :---------------: | :-----------------------------: | :-: |
| [pytz](http://pythonhosted.org/pytz) | 2021.3 | n/a | ✅ |
| [python-slugify](https://github.com/un33k/python-slugify) | 5.0.2 | n/a | ✅ |
| [Pillow](https://python-pillow.org) | 8.4.0 | n/a | ✅ |
| [rcssmin](http://opensource.perlig.de/rcssmin/) | 1.0.6 | n/a | ✅ |
| [argon2-cffi](https://argon2-cffi.readthedocs.io/) | 21.1.0 | n/a | ✅ |
| [whitenoise](https://whitenoise.evans.io) | 5.3.0 | 5.3.0 | ✅ |
| [redis](https://github.com/redis/redis-py) | 4.0.1 | n/a | ✅ |
| [hiredis](https://github.com/redis/hiredis-py) | 2.0.0 | n/a | ✅ |
| [celery](http://celeryproject.org) | 5.2.1 | n/a | ✅ |
| [django-celery-beat](https://github.com/celery/django-celery-beat) | 2.2.1 | 2.21 | ✅ |
| [flower](https://github.com/mher/flower) | 1.0.0 | n/a | ✅ |
| [uvicorn](https://www.uvicorn.org/) | 0.15.0 | n/a | ✅ |
| [django](https://www.djangoproject.com/) | 3.1.13 | n/a | ✅ |
| [django-environ](https://django-environ.readthedocs.org) | 0.8.1 | 0.6.0 | ✅ |
| [django-model-utils](https://github.com/jazzband/django-model-utils) | 4.2.0 | 4.2.0 | ✅ |
| [django-allauth](http://github.com/pennersr/django-allauth) | 0.46.0 | 0.46.0 | ✅ |
| [django-crispy-forms](https://github.com/django-crispy-forms/django-crispy-forms) | 1.13.0 | 1.13.0 | ✅ |
| [crispy-bootstrap5](https://github.com/django-crispy-forms/crispy-bootstrap5) | 0.6 | 0.6 | ✅ |
| [django-compressor](https://django-compressor.readthedocs.io/en/latest/) | 2.4.1 | n/a | ✅ |
| [django-redis](https://github.com/jazzband/django-redis) | 5.0.0 | 5.0.0 | ✅ |
| [djangorestframework](https://www.django-rest-framework.org/) | 3.12.4 | 3.12.4 | ✅ |
| [django-cors-headers](https://github.com/adamchainz/django-cors-headers) | 3.10.0 | 3.10.0 | ✅ |


## local.txt

| Name | Version in Master | 3.2 Compatible Version | OK |
| ---- | :---------------: | :-----------------------------: | :-: |
| [Werkzeug](https://palletsprojects.com/p/werkzeug/) | 2.0.2 | n/a | ✅ |
| [ipdb](https://github.com/gotcha/ipdb) | 0.13.9 | n/a | ✅ |
| [psycopg2](https://psycopg.org/) | 2.9.2 | n/a | ✅ |
| [psycopg2-binary](https://psycopg.org/) | 2.9.2 | n/a | ✅ |
| [watchgod](https://github.com/samuelcolvin/watchgod) | 0.7 | n/a | ✅ |
| [mypy](http://www.mypy-lang.org/) | 0.910 | n/a | ✅ |
| [django-stubs](https://github.com/typeddjango/django-stubs) | 1.8.0 | 1.9.0 | ✅ |
| [pytest](https://docs.pytest.org/en/latest/) | 6.2.5 | n/a | ✅ |
| [pytest-sugar](http://pivotfinland.com/pytest-sugar/) | 0.9.4 | n/a | ✅ |
| [djangorestframework-stubs](https://github.com/typeddjango/djangorestframework-stubs) | 1.4.0 | n/a | ✅ |
| [sphinx](https://www.sphinx-doc.org/) | 4.3.0 | n/a | ✅ |
| [sphinx-autobuild](https://github.com/executablebooks/sphinx-autobuild) | 2021.3.14 | n/a | ✅ |
| [flake8](https://github.com/pycqa/flake8) | 4.0.1 | n/a | ✅ |
| [flake8-isort](https://github.com/gforcada/flake8-isort) | 4.1.1 | n/a | ✅ |
| [coverage](https://github.com/nedbat/coveragepy) | 6.1.2 | n/a | ✅ |
| [black](https://github.com/psf/black) | 21.11b1 | n/a | ✅ |
| [pylint-django](https://github.com/PyCQA/pylint-django) | 2.4.4 | 2.4.4 | ✅ |
| [pylint-celery](https://github.com/landscapeio/pylint-celery) | 0.3 | n/a | ✅ |
| [pre-commit](https://github.com/pre-commit/pre-commit) | 2.15.0 | n/a | ✅ |
| [factory-boy](https://github.com/FactoryBoy/factory_boy) | 3.2.1 | 3.2.1 | ✅ |
| [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar) | 3.2.2 | 3.2.2 | ✅ |
| [django-extensions](http://github.com/django-extensions/django-extensions) | 3.1.5 | 3.1.5 | ✅ |
| [django-coverage-plugin](https://github.com/nedbat/django_coverage_plugin) | 2.0.2 | 2.0.2 | ✅ |
| [pytest-django](https://pytest-django.readthedocs.io/) | 4.4.0 | 4.4.0 | ✅ |


## production.txt

| Name | Version in Master | 3.2 Compatible Version | OK |
| ---- | :---------------: | :-----------------------------: | :-: |
| [gunicorn](https://gunicorn.org) | 20.1.0 | n/a | ✅ |
| [psycopg2](https://psycopg.org/) | 2.9.2 | n/a | ✅ |
| [Collectfast](https://github.com/antonagestam/collectfast/) | 2.2.0 | n/a | ✅ |
| [sentry-sdk](https://github.com/getsentry/sentry-python) | 1.5.0 | n/a | ✅ |
| [hiredis](https://github.com/redis/hiredis-py) | 2.0.0 | n/a | ✅ |
| [django-storages](https://github.com/jschneier/django-storages) | 1.12.3 | 1.12.3 | ✅ |
| [django-anymail](https://github.com/anymail/django-anymail) | 8.4 | 8.3 | ✅ |



Discussion:
@Andrew-Chen-Wang @browniebroke this is really AWESOME 🎉 🎆 . Thank you.
> @Andrew-Chen-Wang @browniebroke this is really AWESOME

I totally agree with this, good work! 
Well done @Andrew-Chen-Wang and @browniebroke. I am concerned though since I don't know how the bot picks the compatible software. Do the package devs have to explicitly tag it to work with Django 3.2?

I ask because `django-environ` 0.8.1 has been tested with 3.2 and it is stated in their documentation.  
"It’s rigorously tested on Python 3.5+, and officially supports Django 1.11, 2.2, 3.0, 3.1 and 3.2." [https://django-environ.readthedocs.io/en/latest/#project-information](https://django-environ.readthedocs.io/en/latest/#project-information)
> Well done @Andrew-Chen-Wang and @browniebroke. I am concerned though since I don't know how the bot picks the compatible software. Do the package devs have to explicitly tag it to work with Django 3.2?
> 
> 
> 
> I ask because `django-environ` 0.8.1 has been tested with 3.2 and it is stated in their documentation.  
> 
> "It’s rigorously tested on Python 3.5+, and officially supports Django 1.11, 2.2, 3.0, 3.1 and 3.2." [https://django-environ.readthedocs.io/en/latest/#project-information](https://django-environ.readthedocs.io/en/latest/#project-information)

We use the Trove classifiers in setup.py. django-environ was pretty inactive so I made it a special case.
@Afrowave for the most part, as explained somewhere in the original PR, this is supposed to help identify packages that are definitely supported. Those that aren't can be manually checked especially if it's very few in the table.
@Andrew-Chen-Wang that sounds reasonable. I like the words "definitely supported". :smile:
I have been using 3.2 for some time now.

I don't have djangorestframework so, I can't really tell.

django-allauth was really the only issue I had in the cookie-cutter bundle, and it has been solved in the latest https://github.com/pennersr/django-allauth/commit/36dd5a7dad52429143434517c50811927283e0bb commit, that remains unreleased for two months now. 
General update of the Red Xs:

### **django-celery-beat:** 
despite not being clearly stated, the 2.2.1 release commit https://github.com/celery/django-celery-beat/commit/a979d0a6a32e56e116a3fddaacd0d03ea79d0960 already had 

> "enable Django 3.2 CI and add default_auto_field" 

in a comment. I have been using it with 3.2 and it does not show the 3.2 AutoField migration issue. I would classify it as **supporting** django 3.2.

### **django-environ:** 
Release 0.8.1 states in [the docs](https://django-environ.readthedocs.io/en/latest/)  

> "It’s rigorously tested on Python 3.5+, and officially supports Django 1.11, 2.2, 3.0, 3.1 and 3.2."

As such, I would classify it as **supporting** Django 3.2.

### **djangorestframework**
Release 3.12.4 states in [the docs](https://www.django-rest-framework.org/#requirements):

> Requirements
> REST framework requires the following:
> Python (3.5, 3.6, 3.7, 3.8, 3.9)
> Django (2.2, 3.0, 3.1, 3.2)

So, I would classify it as **supporting** Django 3.2.

### **pylint-django**
Release 2.4.4 [changelog](https://github.com/PyCQA/pylint-django/blob/v2.4.4/CHANGELOG.rst) states that testing against Django 3.2 are implemented since release 2.4.3. I would classify it as **supporting** Django 3.2.

### **django-anymail**
Anymail's last commit to master was on Jun 15, which happened after django 3.2's release on Apr 6. [Changelog](https://github.com/anymail/django-anymail/blob/26d2b5caa0fb12ea88d9da82f44944478e215ff6/CHANGELOG.rst) indicates that anymail version 8.2 was already being tested against django 3.2 prerelease. Github [workflow](https://github.com/anymail/django-anymail/blob/d79c3c2c051d6ad1b4b4f9dcf7e9955676ecdb8d/.github/workflows/ci-cd.yml) is testing it against Django 3.2, and tests are passing. setup.py indicates django>=2.0:

>     install_requires=["django>=2.0", "requests>=2.4.3"],

[tox.ini](https://github.com/anymail/django-anymail/blob/adc92f037b691d77a0725b96f75ef5ff34983a67/tox.ini) indicates:

> [testenv]
> deps =
> ...
>   django32: django~=3.2.0

For these reasons I would consider django-anymail as **supporting** django 3.2.

### **django-allauth**
Last, but not least, django-allauth lastest release 0.45.0 **does not support** djang 3.2. It will incur in the AutoField breaking change from django 3.1 to django 3.2. A fix is already present (and I personally use it) in HEAD (commit https://github.com/pennersr/django-allauth/commit/36dd5a7dad52429143434517c50811927283e0bb) but sits unreleased for about 2 months now. Pinning it in requirements is my personal workaround, but I wouldn't recommend bumping django to 3.2 until the allauth releases 0.46.0 which will have django 3.2 support.

### Conclusion

Seems like django-allauth is the only real impediment to bumping django to 3.2 at this time. I have opened https://github.com/pennersr/django-allauth/issues/2976 in an attempt to help the process.
Thank you fo going through this list @mpoli. I've updated the table with your comments.
https://github.com/cookiecutter/cookiecutter-django/pull/3407 🎉 

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@
     classifiers=[
         "Development Status :: 4 - Beta",
         "Environment :: Console",
-        "Framework :: Django :: 3.1",
+        "Framework :: Django :: 3.2",
         "Intended Audience :: Developers",
         "Natural Language :: English",
         "License :: OSI Approved :: BSD License",
diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py
--- a/{{cookiecutter.project_slug}}/config/settings/base.py
+++ b/{{cookiecutter.project_slug}}/config/settings/base.py
@@ -48,6 +48,8 @@
 }
 {%- endif %}
 DATABASES["default"]["ATOMIC_REQUESTS"] = True
+# https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-DEFAULT_AUTO_FIELD
+DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
 
 # URLS
 # ------------------------------------------------------------------------------
@@ -86,7 +88,7 @@
 ]
 
 LOCAL_APPS = [
-    "{{ cookiecutter.project_slug }}.users.apps.UsersConfig",
+    "{{ cookiecutter.project_slug }}.users",
     # Your stuff: custom apps go here
 ]
 # https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py
@@ -1,3 +1,4 @@
+# Generated by Django 3.2.9 on 2021-11-20 11:23
 import django.contrib.auth.models
 import django.contrib.auth.validators
 from django.db import migrations, models
@@ -8,7 +9,9 @@ class Migration(migrations.Migration):
 
     initial = True
 
-    dependencies = [("auth", "0008_alter_user_username_max_length")]
+    dependencies = [
+        ("auth", "0012_alter_user_first_name_max_length"),
+    ]
 
     operations = [
         migrations.CreateModel(
@@ -16,7 +19,7 @@ class Migration(migrations.Migration):
             fields=[
                 (
                     "id",
-                    models.AutoField(
+                    models.BigAutoField(
                         auto_created=True,
                         primary_key=True,
                         serialize=False,
@@ -111,10 +114,12 @@ class Migration(migrations.Migration):
                 ),
             ],
             options={
-                "verbose_name_plural": "users",
                 "verbose_name": "user",
+                "verbose_name_plural": "users",
                 "abstract": False,
             },
-            managers=[("objects", django.contrib.auth.models.UserManager())],
-        )
+            managers=[
+                ("objects", django.contrib.auth.models.UserManager()),
+            ],
+        ),
     ]


Test patch: