Repository: cookiecutter/cookiecutter-django
Pull request: Update to Django 3.1
## Description

Django dependencies upgrade.

Checklist:

- [X] I've made sure that `tests/test_cookiecutter_generation.py` is updated accordingly (especially if adding or updating a template option)
- [X] I've updated the documentation or confirm that my change doesn't require any updates

## Rationale

Fix #2795

Problem statement:
Django 3.1
I haven't seen anyone asked this question yet. So I'll go first. Is it ok now to upgrade to django 3.1.x?

Another newbie question: beside the tests that I wrote, is there any other test that I could run to make sure the django-cookiecutter on my computer works with django 3.1.1?

Thank you.

Hints from issue discussion:
I did some research. The very first one was djangorestframework only supports upto django 3.0. Case closed. Sorry about this.
https://www.django-rest-framework.org
Seems latest DRF support Django 3.1. Any plan for go with Django 3.1?
@browniebroke

many packages already update to Django 3.1 support, can regenerate test matrix please
p.s. how you do this matrix ?)
> can regenerate test matrix please

I'm not generating it, I took the table from the Django 3.0 issue and updated versions manually. It's quite tedious but we don't need to do this too often. If someone has a script, it would be helpful...

> many packages already update to Django 3.1 support

Which ones are missing? I'm updating the message as I merge updates, but it's possible that I missed one.
base.txt
======
**django-environ** looks like we don't even need to wait
https://github.com/joke2k/django-environ/issues/239#issuecomment-718918143

**django-allauth** they added Django 3.1 to Travis/tox which I don't know what this means (testing?)

**django-compressor** I don't see an issue reported regarding Django 3.1
Django Compressor is compatible with Django 1.11 and newer.


local.txt
======
**django-stubs** looks like this one is still a no no

**django_coverage_plugin** I don't see an issue reported regarding Django 3.1


production.txt
==========
**Collectfast** I don't see an issue reported regarding Django 3.1

Feel free to send a pull request 👍 
Just found out that `django-stubs` was missing https://github.com/typeddjango/django-stubs/pull/558 and it's now merged. Next release should be good to go.
> Feel free to send a pull request 👍

I'm not that advance of a github user just yet. I'll be there.

Commit message: Update Django 3.0.11 to 3.1.6

Patch to review:
diff --git a/tests/test_docker.sh b/tests/test_docker.sh
index 740f8fc223..f6df6b8ab1 100755
--- a/tests/test_docker.sh
+++ b/tests/test_docker.sh
@@ -30,4 +30,4 @@ docker-compose -f local.yml run django pytest
 docker-compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
 
 # Test support for translations
-docker-compose -f local.yml run django python manage.py makemessages
+docker-compose -f local.yml run django python manage.py makemessages --all
diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt
index b2eaa48eac..1bb928178d 100644
--- a/{{cookiecutter.project_slug}}/requirements/base.txt
+++ b/{{cookiecutter.project_slug}}/requirements/base.txt
@@ -29,7 +29,7 @@ uvicorn[standard]==0.13.3  # https://github.com/encode/uvicorn
 
 # Django
 # ------------------------------------------------------------------------------
-django==3.0.11  # pyup: < 3.1  # https://www.djangoproject.com/
+django==3.1.6  # pyup: < 3.1  # https://www.djangoproject.com/
 django-environ==0.4.5  # https://github.com/joke2k/django-environ
 django-model-utils==4.1.1  # https://github.com/jazzband/django-model-utils
 django-allauth==0.44.0  # https://github.com/pennersr/django-allauth
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py
new file mode 100644
index 0000000000..ffc88bf5c9
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py
@@ -0,0 +1,17 @@
+# Generated by Django 3.1.6 on 2021-02-04 14:49
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('sites', '0003_set_site_domain_and_name'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='site',
+            options={'ordering': ['domain'], 'verbose_name': 'site', 'verbose_name_plural': 'sites'},
+        ),
+    ]


Code review comments:
diff_hunk: @@ -29,7 +29,7 @@ uvicorn[standard]==0.13.3  # https://github.com/encode/uvicorn
 
 # Django
 # ------------------------------------------------------------------------------
-django==3.0.11  # pyup: < 3.1  # https://www.djangoproject.com/
+django==3.1.6  # pyup: < 3.1  # https://www.djangoproject.com/
path: {{cookiecutter.project_slug}}/requirements/base.txt
text: @user1:
We also need to update the PyUP filter to keep receiving updates:

```suggestion
django==3.1.6  # pyup: < 3.2  # https://www.djangoproject.com/
```

@author:
Well spotted!