Upgrade to Django 3.2 (#3425)

* Upgrade to Django 3.2

* Set DEFAULT_AUTO_FIELD setting

* Use auto AppConfig discovery for users app
This commit is contained in:
Bruno Alla 2021-11-24 08:05:53 +00:00 committed by GitHub
parent 23de88cc59
commit 315ead02e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 9 deletions

View File

@ -41,7 +41,7 @@ production-ready Django projects quickly.
Features
---------
* For Django 3.1
* For Django 3.2
* Works with Python 3.9
* Renders Django projects with 100% starting test coverage
* Twitter Bootstrap_ v5 (`maintained Foundation fork`_ also available)

View File

@ -24,7 +24,7 @@ setup(
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",

View File

@ -48,6 +48,8 @@ DATABASES = {
}
{%- 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 @@ THIRD_PARTY_APPS = [
]
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

View File

@ -29,7 +29,7 @@ uvicorn[standard]==0.15.0 # https://github.com/encode/uvicorn
# Django
# ------------------------------------------------------------------------------
django==3.1.13 # pyup: < 3.2 # https://www.djangoproject.com/
django==3.2.9 # pyup: < 4.0 # https://www.djangoproject.com/
django-environ==0.8.1 # https://github.com/joke2k/django-environ
django-model-utils==4.2.0 # https://github.com/jazzband/django-model-utils
django-allauth==0.46.0 # https://github.com/pennersr/django-allauth

View File

@ -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()),
],
),
]