From 7fa217f2051f261c78433f9b69286e8ec0be58d5 Mon Sep 17 00:00:00 2001 From: Jens Kadenbach Date: Thu, 12 Sep 2019 13:28:52 +0200 Subject: [PATCH] Use whitenoise to serve statices and use port 5000 --- actual_production.yml | 2 +- config/settings/base.py | 1 + production.yml | 2 +- requirements/base.txt | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/actual_production.yml b/actual_production.yml index 918a85b..9e2fb10 100644 --- a/actual_production.yml +++ b/actual_production.yml @@ -18,7 +18,7 @@ services: - ./.envs/.production/.postgres command: /start ports: - - "8000:5000" + - "5000:5000" postgres: build: diff --git a/config/settings/base.py b/config/settings/base.py index 9cb2cf2..c154d3e 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -124,6 +124,7 @@ AUTH_PASSWORD_VALIDATORS = [ # https://docs.djangoproject.com/en/dev/ref/settings/#middleware MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", + "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.locale.LocaleMiddleware", "django.middleware.common.CommonMiddleware", diff --git a/production.yml b/production.yml index 918a85b..9e2fb10 100644 --- a/production.yml +++ b/production.yml @@ -18,7 +18,7 @@ services: - ./.envs/.production/.postgres command: /start ports: - - "8000:5000" + - "5000:5000" postgres: build: diff --git a/requirements/base.txt b/requirements/base.txt index 63f91df..a84ca3d 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -22,3 +22,4 @@ coreapi==2.3.3 # https://github.com/core-api/python-client django-markdownx==2.0.28 WeasyPrint==48 django-weasyprint==0.5.4 +whitenoise==4.1.3