From 72c4020d96fb4015705a94094adc1a0acca7d7ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Mon, 1 Mar 2021 20:34:51 +0100 Subject: [PATCH] Add whitenoise. --- poetry.lock | 25 ++++++++++++++++++++----- pyproject.toml | 1 + src/project/settings.py | 1 + 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index bc28248..96ee153 100644 --- a/poetry.lock +++ b/poetry.lock @@ -248,11 +248,11 @@ python-versions = ">=3.6" [[package]] name = "identify" -version = "1.6.1" +version = "2.0.0" description = "File identification library for Python" category = "dev" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +python-versions = ">=3.6.1" [package.extras] license = ["editdistance"] @@ -596,10 +596,21 @@ category = "dev" optional = false python-versions = "*" +[[package]] +name = "whitenoise" +version = "5.2.0" +description = "Radically simplified static file serving for WSGI applications" +category = "main" +optional = false +python-versions = ">=3.5, <4" + +[package.extras] +brotli = ["brotli"] + [metadata] lock-version = "1.1" python-versions = "^3.9" -content-hash = "674f0367589d624ac48e1d8d61639dff1ddad4ee0e5e90de796897dabe9fc976" +content-hash = "273466dbd53a484027b72a712aba600936507cd2d528c9a245464637c0c54207" [metadata.files] appdirs = [ @@ -739,8 +750,8 @@ h11 = [ {file = "h11-0.12.0.tar.gz", hash = "sha256:47222cb6067e4a307d535814917cd98fd0a57b6788ce715755fa2b6c28b56042"}, ] identify = [ - {file = "identify-1.6.1-py2.py3-none-any.whl", hash = "sha256:ec4698722b9a8a6f2aa5f9ff9cc687956494f0ba734941659ad7f018cf457e44"}, - {file = "identify-1.6.1.tar.gz", hash = "sha256:7b435803dc79a0f0ce887887a62ad360f3a9e8162ac0db9ee649d5d24085bf30"}, + {file = "identify-2.0.0-py2.py3-none-any.whl", hash = "sha256:9cdd81e5d2b6e76c3006d5226316dd947bd6324fbeebb881bec489202fa09d3a"}, + {file = "identify-2.0.0.tar.gz", hash = "sha256:b99aa309329c4fea679463eb35d169f3fbe13e66e9dd6162ad1856cbeb03dcbd"}, ] idna = [ {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, @@ -891,3 +902,7 @@ wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, ] +whitenoise = [ + {file = "whitenoise-5.2.0-py2.py3-none-any.whl", hash = "sha256:05d00198c777028d72d8b0bbd234db605ef6d60e9410125124002518a48e515d"}, + {file = "whitenoise-5.2.0.tar.gz", hash = "sha256:05ce0be39ad85740a78750c86a93485c40f08ad8c62a6006de0233765996e5c7"}, +] diff --git a/pyproject.toml b/pyproject.toml index 1294b13..ee4ca55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ django-allauth = "^0.44.0" psycopg2 = "^2.8.6" environs = {extras = ["django"], version = "^9.3.1"} uvicorn = "^0.13.4" +whitenoise = "^5.2.0" [tool.poetry.dev-dependencies] pre-commit = "^2.9.3" diff --git a/src/project/settings.py b/src/project/settings.py index e581917..281a246 100644 --- a/src/project/settings.py +++ b/src/project/settings.py @@ -40,6 +40,7 @@ DATABASES = {"default": env.dj_db_url("DATABASE_URL")} MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", + "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware",