Skip to content

Commit

Permalink
feat: upgrade to Django 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
engineervix committed Jul 20, 2021
1 parent 5a5be14 commit 6a5e7cd
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 33 deletions.
5 changes: 4 additions & 1 deletion {{cookiecutter.project_slug}}/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import os
from typing import List

import environ

Expand Down Expand Up @@ -231,7 +232,7 @@
NEXMO_API_SECRET = env("NEXMO_API_SECRET")
NEXMO_DEFAULT_FROM = env("NEXMO_DEFAULT_FROM")

LIST_OF_EMAIL_RECIPIENTS = []
LIST_OF_EMAIL_RECIPIENTS: List[str] = []

ADMINS = (
("{{cookiecutter.author_name}}", "{{cookiecutter.email}}"), # email will be sent to your_email
Expand Down Expand Up @@ -265,3 +266,5 @@
COMPRESS_STORAGE = "compressor.storage.GzipCompressorFileStorage"

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
42 changes: 27 additions & 15 deletions {{cookiecutter.project_slug}}/requirements.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# Core
django>=3.1,<4.0
wagtail>=2.12,<3.0
argon2-cffi
bcrypt
beautifulsoup4
bleach
brotli
csscompressor
django[argon2,bcrypt]>=3.1,<4.0
wagtail>=2.13,<3.0

# Django Extensions
django-autoslug
django-colorful
django-compressor
Expand All @@ -23,39 +19,51 @@ django-multiselectfield
django-nexmo==2.0.0a1
django-phonenumber-field
django-recaptcha
django-redis
django-social-share
django-user-agents
django-widget-tweaks

# Wagtail Extensions
wagtailfontawesome

# Other third-party libraries
beautifulsoup4
bleach
brotli
csscompressor
feedparser
hiredis
html5lib
lz4 # for django_redis.compressors.lz4.Lz4Compressor
openpyxl
phonenumbers
psycopg2
pyyaml
readtime
simplejson
slimit
titlecase
ua-parser
user-agents
werkzeug
wagtailfontawesome
xlrd
xlwt
yattag

# Dev
# Developer Tools
bpython
black
commitizen
doc8
flake8
powerline-status
invoke
isort[requirements_deprecated_finder]
pip-tools
pre-commit
pipdeptree
pip-tools>=5.5
powerline-status
pre-commit>=2.9.2

# Test
# Testing
fake-useragent
faker-e164
pytest-cov
Expand All @@ -67,3 +75,7 @@ pytest-mock
pytest-sugar
pytest-xdist
wagtail-factories @ https://github.com/wagtail/wagtail-factories/archive/master.zip

# Production
pymemcache
sentry-sdk
38 changes: 29 additions & 9 deletions {{cookiecutter.project_slug}}/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile
# pip-compile requirements.in
#
anyascii==0.1.7
# via wagtail
Expand All @@ -13,13 +13,13 @@ appdirs==1.4.4
# black
# virtualenv
argon2-cffi==20.1.0
# via -r requirements.in
asgiref==3.3.1
# via django
asgiref==3.4.1
# via django
attrs==20.2.0
# via pytest
bcrypt==3.2.0
# via -r requirements.in
# via django
beautifulsoup4==4.9.3
# via
# -r requirements.in
Expand All @@ -36,7 +36,9 @@ bpython==0.21
brotli==1.0.9
# via -r requirements.in
certifi==2020.6.20
# via requests
# via
# requests
# sentry-sdk
cffi==1.14.3
# via
# argon2-cffi
Expand Down Expand Up @@ -76,7 +78,7 @@ deprecated==1.2.10
# via nexmo
distlib==0.3.1
# via virtualenv
django==3.1.13
django[argon2,bcrypt]==3.2.5
# via
# -r requirements.in
# django-appconf
Expand All @@ -92,6 +94,7 @@ django==3.1.13
# django-multiselectfield
# django-phonenumber-field
# django-recaptcha
# django-redis
# django-taggit
# django-treebeard
# django-user-agents
Expand Down Expand Up @@ -136,6 +139,8 @@ django-phonenumber-field==5.2.0
# via -r requirements.in
django-recaptcha==2.0.6
# via -r requirements.in
django-redis==5.0.0
# via -r requirements.in
django-social-share==2.2.1
# via -r requirements.in
django-taggit==1.3.0
Expand Down Expand Up @@ -184,6 +189,8 @@ future==0.18.2
# via pytest-logger
greenlet==0.4.17
# via bpython
hiredis==2.0.0
# via -r requirements.in
html5lib==1.1
# via
# -r requirements.in
Expand All @@ -196,6 +203,8 @@ inflection==0.5.1
# via pytest-factoryboy
iniconfig==1.1.1
# via pytest
invoke==1.6.0
# via -r requirements.in
isort[requirements_deprecated_finder]==5.9.2
# via -r requirements.in
jinja2==2.11.3
Expand All @@ -204,6 +213,8 @@ l18n==2020.6.1
# via wagtail
lxml==4.6.3
# via pyquery
lz4==3.1.3
# via -r requirements.in
markdown2==2.4.0
# via readtime
markupsafe==1.1.1
Expand Down Expand Up @@ -242,6 +253,8 @@ pip-api==0.0.14
# via isort
pip-tools==6.2.0
# via -r requirements.in
pipdeptree==2.0.0
# via -r requirements.in
pipreqs==0.4.10
# via isort
pluggy==0.13.1
Expand Down Expand Up @@ -272,6 +285,8 @@ pygments==2.9.0
# doc8
pyjwt[crypto]==1.7.1
# via nexmo
pymemcache==3.5.0
# via -r requirements.in
pyparsing==2.4.7
# via packaging
pyquery==1.4.1
Expand Down Expand Up @@ -328,6 +343,8 @@ rcssmin==1.0.6
# via django-compressor
readtime==1.1.1
# via -r requirements.in
redis==3.5.3
# via django-redis
regex==2020.9.27
# via black
requests==2.24.0
Expand All @@ -340,10 +357,10 @@ restructuredtext-lint==1.3.1
# via doc8
rjsmin==1.1.0
# via django-compressor
sentry-sdk==1.3.0
# via -r requirements.in
sgmllib3k==1.0.0
# via feedparser
simplejson==3.17.3
# via -r requirements.in
six==1.15.0
# via
# argon2-cffi
Expand All @@ -356,6 +373,7 @@ six==1.15.0
# html5lib
# l18n
# packaging
# pymemcache
# python-dateutil
# virtualenv
slimit==0.8.1
Expand Down Expand Up @@ -397,7 +415,9 @@ ua-parser==0.10.0
# -r requirements.in
# user-agents
urllib3==1.25.11
# via requests
# via
# requests
# sentry-sdk
user-agents==2.2.0
# via
# -r requirements.in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class BaseConfig(AppConfig):
name = "base"
name = "{{cookiecutter.project_slug}}.base"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.5 on 2021-07-20 20:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('base', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='people',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_people():

@pytest.mark.django_db
def test_base_app():
assert BaseConfig.name == "base"
assert BaseConfig.name == "{{cookiecutter.project_slug}}.base"
assert apps.get_app_config("base").name == "{{cookiecutter.project_slug}}.base"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class BlogConfig(AppConfig):
name = "blog"
name = "{{cookiecutter.project_slug}}.blog"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.5 on 2021-07-20 20:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('blog', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='articletag',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_blog(client):

@pytest.mark.django_db
def test_blog_app():
assert BlogConfig.name == "blog"
assert BlogConfig.name == "{{cookiecutter.project_slug}}.blog"
assert apps.get_app_config("blog").name == "{{cookiecutter.project_slug}}.blog"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class ContactConfig(AppConfig):
name = "contact"
name = "{{cookiecutter.project_slug}}.contact"
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.5 on 2021-07-20 20:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('contact', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='contactpageemailaddress',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='contactpagephonenumber',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,5 @@ def test_send_mail_bad_header_error(

@pytest.mark.django_db
def test_contact_app():
assert ContactConfig.name == "contact"
assert ContactConfig.name == "{{cookiecutter.project_slug}}.contact"
assert apps.get_app_config("contact").name == "{{cookiecutter.project_slug}}.contact"
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class HomeConfig(AppConfig):
name = "home"
name = "{{cookiecutter.project_slug}}.home"
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ def test_aboutpage(client):

@pytest.mark.django_db
def test_home_app():
assert HomeConfig.name == "home"
assert HomeConfig.name == "{{cookiecutter.project_slug}}.home"
assert apps.get_app_config("home").name == "{{cookiecutter.project_slug}}.home"

0 comments on commit 6a5e7cd

Please sign in to comment.