From 5087d128637f70e10879d1d9c3f8f7fd4673cc39 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Thu, 30 Aug 2018 20:14:45 +0200 Subject: Properly configure Django project. --- .gitlab-ci.yml | 1 + SETUP.md | 1 - pysite/settings.py | 8 +++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 131e2089..b455fa0c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ test: services: - postgres:10-alpine script: + - python manage.py migrate - python manage.py test variables: DATABASE_URL: postgres://django:supersecret@postgres/pysite diff --git a/SETUP.md b/SETUP.md index 2a8c64e9..dd974338 100644 --- a/SETUP.md +++ b/SETUP.md @@ -6,7 +6,6 @@ - `psql -c 'CREATE DATABASE pysite OWNER pysite;'` - `echo 'DEBUG=1' >> .env` - `echo 'DATABASE_URL=postgres://pysite:@localhost/pysite' >> .env` -- `echo 'BOT_API_KEY=123456' >> .env` - `pipenv shell` - `python manage.py migrate` - `python manage.py runserver` diff --git a/pysite/settings.py b/pysite/settings.py index 16235e09..c7a21083 100644 --- a/pysite/settings.py +++ b/pysite/settings.py @@ -40,6 +40,11 @@ if DEBUG: 'wiki.pythondiscord.local' ] SECRET_KEY = "+_x00w3e94##2-qm-v(5&-x_@*l3t9zlir1etu+7$@4%!it2##" + +elif 'CI' in os.environ: + ALLOWED_HOSTS = ['*'] + SECRET_KEY = "{©ø¬½.Þ7&Ñ`Q^Kº*~¢j