Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(async): add uvicorn, asgi, upgrade django=4.1 #473

Merged
merged 13 commits into from
Nov 27, 2023
18 changes: 18 additions & 0 deletions {{cookiecutter.github_repository}}/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Standard Library
import os

# Third Party Stuff
from django.core.asgi import get_asgi_application
from dotenv import load_dotenv

# Read .env file and set key/value inside it as environement variables
# see: http://github.com/theskumar/python-dotenv
load_dotenv(os.path.join(os.path.dirname(__file__), ".env"))

# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings.development'
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.production")
sun337 marked this conversation as resolved.
Show resolved Hide resolved

application = get_asgi_application()
5 changes: 3 additions & 2 deletions {{cookiecutter.github_repository}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ authors = ["{{cookiecutter.default_from_email}}"]

[tool.poetry.dependencies]
python = "~3.9"
Django = "~3.2.15"
Django = "4.1"
sun337 marked this conversation as resolved.
Show resolved Hide resolved
django-environ = "^0.9"
django-sites = "^0.11"
django-filter = "^21.1"
argon2-cffi = "^21.3"
python-dotenv = "^0.21"
django-cors-headers = "^3.13"
{% if cookiecutter.enable_whitenoise.lower() == 'y' -%}
whitenoise = "^6.2"
whitenoise = "^6.4.0"
{%- endif %}

# Extensions
Expand Down Expand Up @@ -78,6 +78,7 @@ django-mail-templated = "^2.6"
# Static Files and Media Storage
# -------------------------------------
gunicorn = "~20.1.0"
uvicorn = "^0.21.0"
theskumar marked this conversation as resolved.
Show resolved Hide resolved
django-storages = "^1.13"
boto3 = "~1.26.47"

Expand Down