-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from snok/django31asgi
ASGI and async support
- Loading branch information
Showing
37 changed files
with
1,171 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,8 +35,8 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.6", "3.7", "3.8", "3.9" ] | ||
django-version: [ "2.2", "3.0", "3.1" ] | ||
python-version: [ "3.7", "3.8", "3.9" ] | ||
django-version: [ "3.1.1", "3.1.2" ] | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
@@ -48,13 +48,12 @@ jobs: | |
uses: sondrelg/[email protected] | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-4 | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-5 | ||
- name: Install dependencies | ||
run: | | ||
source $HOME/.poetry/env | ||
|
@@ -63,11 +62,9 @@ jobs: | |
- name: Install django ${{ matrix.django-version }} | ||
run: | | ||
source $HOME/.poetry/env | ||
python -m pip install "Django==${{ matrix.django-version }}" --upgrade --force-reinstall | ||
poetry run pip install "Django==${{ matrix.django-version }}" | ||
- name: Run tests | ||
run: | | ||
source $HOME/.poetry/env | ||
poetry run pytest --cov=django_guid tests/ | ||
poetry run coverage report | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
ASGI config for demoproj_asgi project. | ||
It exposes the ASGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.asgi import get_asgi_application | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demoproj.settings') | ||
|
||
application = get_asgi_application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import asyncio | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
async def useless_function() -> bool: | ||
""" | ||
Useless function to demonstrate a function log message. | ||
:return: True | ||
""" | ||
logger.info('Going to sleep for a sec') | ||
await asyncio.sleep(1) | ||
|
||
logger.warning('Warning, I am awake!') | ||
return True |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.