diff --git a/poetry.lock b/poetry.lock index aec54d64..7a8c1a46 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,14 @@ +[[package]] +category = "main" +description = "ASGI specs, helper code, and adapters" +name = "asgiref" +optional = false +python-versions = ">=3.5" +version = "3.2.7" + +[package.extras] +tests = ["pytest (>=4.3.0,<4.4.0)", "pytest-asyncio (>=0.10.0,<0.11.0)"] + [[package]] category = "dev" description = "A tool that automatically formats Python code to conform to the PEP 8 style guide" @@ -38,12 +49,13 @@ category = "main" description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design." name = "django" optional = false -python-versions = ">=3.5" -version = "2.2.12" +python-versions = ">=3.6" +version = "3.0.5" [package.dependencies] +asgiref = ">=3.2,<4.0" pytz = "*" -sqlparse = "*" +sqlparse = ">=0.2.2" [package.extras] argon2 = ["argon2-cffi (>=16.1.0)"] @@ -369,10 +381,14 @@ version = "5.0.1" brotli = ["brotli"] [metadata] -content-hash = "e570a1ca3aa64f5a5f6085d755d16b38c576c4e7646e0a09d6c9c2f542d91a0f" +content-hash = "dc24924af5d09a738f15f1cd61f77d01c8d32acacf4c39dd2401d654f0439f99" python-versions = "^3.7" [metadata.files] +asgiref = [ + {file = "asgiref-3.2.7-py2.py3-none-any.whl", hash = "sha256:9ca8b952a0a9afa61d30aa6d3d9b570bb3fd6bafcf7ec9e6bed43b936133db1c"}, + {file = "asgiref-3.2.7.tar.gz", hash = "sha256:8036f90603c54e93521e5777b2b9a39ba1bad05773fcf2d208f0299d1df58ce5"}, +] autopep8 = [ {file = "autopep8-1.5.1.tar.gz", hash = "sha256:cc6be1dfd46f2c7fa00e84a357f1a269683985b09eaffb47654ed551194399eb"}, ] @@ -389,8 +405,8 @@ dj-database-url = [ {file = "dj_database_url-0.5.0-py2.py3-none-any.whl", hash = "sha256:851785365761ebe4994a921b433062309eb882fedd318e1b0fcecc607ed02da9"}, ] django = [ - {file = "Django-2.2.12-py3-none-any.whl", hash = "sha256:6ecd229e1815d4fc5240fc98f1cca78c41e7a8cd3e3f2eefadc4735031077916"}, - {file = "Django-2.2.12.tar.gz", hash = "sha256:69897097095f336d5aeef45b4103dceae51c00afa6d3ae198a2a18e519791b7a"}, + {file = "Django-3.0.5-py3-none-any.whl", hash = "sha256:642d8eceab321ca743ae71e0f985ff8fdca59f07aab3a9fb362c617d23e33a76"}, + {file = "Django-3.0.5.tar.gz", hash = "sha256:d4666c2edefa38c5ede0ec1655424c56dc47ceb04b6d8d62a7eac09db89545c1"}, ] django-braces = [ {file = "django-braces-1.14.0.tar.gz", hash = "sha256:83705b78948de00804bfacf40c315d001bb39630f35bbdd8588211c2d5b4d43f"}, diff --git a/pyproject.toml b/pyproject.toml index 8fd7a9c7..72c05370 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ requests = "^2.23.0" six = "^1.14.0" stripe = "^2.45.0" whitenoise = "^5.0.1" -Django = "~2.2.12" +Django = "~3.0.5" Padding = "^0.5" SQLAlchemy = "^1.3.16" django-postgrespool2 = "^1.0.1" diff --git a/swapi/views.py b/swapi/views.py index 56bcc71d..e63abc8e 100644 --- a/swapi/views.py +++ b/swapi/views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from django.shortcuts import render_to_response, redirect +from django.shortcuts import render, redirect from django.views.decorators.csrf import csrf_exempt from django.core.cache import cache from django.conf import settings @@ -16,7 +16,8 @@ def index(request): stripe_key = settings.STRIPE_KEYS['publishable'] - return render_to_response( + return render( + request, 'index.html', { "stripe_key": stripe_key @@ -25,7 +26,7 @@ def index(request): def documentation(request): - return render_to_response("documentation.html") + return render(request, "documentation.html") def about(request): @@ -35,7 +36,8 @@ def about(request): data = get_resource_stats() cache.set('resource_data', data, 10000) data['stripe_key'] = stripe_key - return render_to_response( + return render( + request, "about.html", data ) @@ -71,7 +73,8 @@ def stripe_donation(request): @login_required def stats(request): data = {} - return render_to_response( + return render( + request, 'stats.html', data )