Skip to content

Commit

Permalink
ZDL-100: Upgrade Django versions and set production environment settings
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanAquino committed Mar 21, 2022
1 parent 7ea9d6b commit 2feca74
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 15 deletions.
33 changes: 18 additions & 15 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
appdirs==1.4.4
asgiref==3.2.10
arrow==1.2.1
asgiref==3.5.0
atomicwrites==1.4.0
attrs==19.3.0
black==20.8b1
Expand All @@ -13,13 +14,13 @@ coreapi==2.3.3
coreschema==0.0.4
coverage==5.3.1
Deprecated==1.2.13
Django==3.0.8
Django==3.2.12
django-cors-headers==3.7.0
django-rq==2.5.1
djangorestframework==3.11.0
djangorestframework-simplejwt==4.4.0
djangorestframework==3.13.1
djangorestframework-simplejwt==5.1.0
dnspython==2.1.0
drf-yasg==1.17.1
drf-yasg==1.20.0
factory-boy==3.2.0
Faker==8.8.0
filelock==3.4.0
Expand All @@ -37,15 +38,15 @@ inflection==0.5.1
iniconfig==1.0.1
isort==5.10.1
itypes==1.2.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Jinja2==3.0.3
MarkupSafe==2.1.1
mccabe==0.6.1
more-itertools==8.5.0
mypy==0.782
mypy==0.941
mypy-extensions==0.4.3
packaging==20.4
pathspec==0.8.0
Pillow==7.2.0
Pillow==9.0.1
pluggy==0.13.1
protobuf==3.19.4
psycopg2-binary==2.8.6
Expand All @@ -54,13 +55,13 @@ py3-validate-email==1.0.5
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.6.0
pydantic==1.6.1
pydantic==1.9.0
pyflakes==2.2.0
PyJWT==1.7.1
pyparsing==2.4.7
pytest==6.0.1
pytest-cov==2.10.1
pytest-django==3.9.0
pytest==7.1.0
pytest-cov==3.0.0
pytest-django==4.5.2
python-dateutil==2.8.1
pytz==2020.1
redis==4.0.2
Expand All @@ -74,11 +75,13 @@ ruamel.yaml.clib==0.2.2
six==1.15.0
sqlparse==0.3.1
text-unidecode==1.3
times==0.7
toml==0.10.1
tomli==2.0.1
typed-ast==1.4.1
typing-extensions==3.7.4.2
typing-extensions==4.1.1
uritemplate==3.0.1
urllib3==1.25.10
urllib3==1.26.9
whitenoise==5.2.0
wrapt==1.13.3
zipp==3.1.0
24 changes: 24 additions & 0 deletions zadalaAPI/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,27 @@

GOOGLE_CLIENT_ID = os.environ.get("GOOGLE_CLIENT_ID", GOOGLE_CLIENT_ID)
GOOGLE_CLIENT_SECRET = os.environ.get("GOOGLE_CLIENT_SECRET", GOOGLE_CLIENT_SECRET)

# Django 3.2
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

# https://docs.djangoproject.com/en/4.0/ref/settings/#std:setting-SESSION_COOKIE_SECURE
SESSION_COOKIE_SECURE = (
True
if "SESSION_COOKIE_SECURE" in os.environ and os.environ["SESSION_COOKIE_SECURE"]
else False
)

# https://docs.djangoproject.com/en/4.0/ref/settings/#std:setting-SECURE_SSL_REDIRECT
SECURE_SSL_REDIRECT = (
True
if "SECURE_SSL_REDIRECT" in os.environ and os.environ["SECURE_SSL_REDIRECT"]
else False
)

# https://docs.djangoproject.com/en/4.0/ref/settings/#std:setting-CSRF_COOKIE_SECURE
CSRF_COOKIE_SECURE = (
True
if "CSRF_COOKIE_SECURE" in os.environ and os.environ["CSRF_COOKIE_SECURE"]
else False
)

0 comments on commit 2feca74

Please sign in to comment.