From 2630c614e707f053c2732941cf11f2d895865fe8 Mon Sep 17 00:00:00 2001 From: ajurna Date: Tue, 26 May 2020 10:12:04 +0100 Subject: [PATCH] fix for URL's not working correctly behind a reverse proxy. --- Pipfile | 1 + Pipfile.lock | 10 +++++++++- cbreader/settings/base.py | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 2602c3d..9c830b6 100644 --- a/Pipfile +++ b/Pipfile @@ -15,6 +15,7 @@ django-recaptcha2 = "*" django-bootstrap4 = "*" dj-database-url = "*" pypdf4 = "*" +python-dotenv = "*" [requires] python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index 0c19033..5d9443a 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "b56ff3d531e5d0251ac92d567b1a331495fbbf87740086710afe6e4a0d61d6a7" + "sha256": "24dc60dfd360e3b070182ba6e7d35553ca1714d613d316a3b04f7ca6b1415ee4" }, "pipfile-spec": 6, "requires": { @@ -99,6 +99,14 @@ "index": "pypi", "version": "==1.27.0" }, + "python-dotenv": { + "hashes": [ + "sha256:25c0ff1a3e12f4bde8d592cc254ab075cfe734fc5dd989036716fd17ee7e5ec7", + "sha256:3b9909bc96b0edc6b01586e1eed05e71174ef4e04c71da5786370cebea53ad74" + ], + "index": "pypi", + "version": "==0.13.0" + }, "pytz": { "hashes": [ "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed", diff --git a/cbreader/settings/base.py b/cbreader/settings/base.py index 9c3042e..8f3d3db 100644 --- a/cbreader/settings/base.py +++ b/cbreader/settings/base.py @@ -4,11 +4,12 @@ Django settings for cbreader project. # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os - +from dotenv import load_dotenv import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +load_dotenv(BASE_DIR) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/