From 96e699f42ff74988b7aaa216e4fa4dd949b45cf4 Mon Sep 17 00:00:00 2001
From: Florimond Manca <florimond.manca@gmail.com>
Date: Fri, 28 Feb 2020 21:16:53 +0100
Subject: [PATCH] Automatically load environment variables from .env file (#14)

---
 oser_backend/settings/common.py | 3 +++
 requirements.txt                | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/oser_backend/settings/common.py b/oser_backend/settings/common.py
index ca0a607..eca12cc 100644
--- a/oser_backend/settings/common.py
+++ b/oser_backend/settings/common.py
@@ -5,10 +5,13 @@ Common settings suitable for all environmebts.
 """
 
 import os
+from dotenv import load_dotenv
 
 import dj_database_url
 import pymdownx.emoji
 
+load_dotenv()
+
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
 dn = os.path.dirname
 BASE_DIR = dn(dn(dn(os.path.abspath(__file__))))
diff --git a/requirements.txt b/requirements.txt
index 924e008..85baa93 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -35,6 +35,9 @@ Pillow
 # Testing
 factory-boy
 
+# Miscellanneous
+python-dotenv==0.11
+
 # Deployment
 django-heroku  # Heroku integration
 whitenoise  # Static files serving
-- 
GitLab