From af75b7e99edaab61d3593c286d8bb52b7b0964be Mon Sep 17 00:00:00 2001 From: rz Date: Wed, 6 Sep 2023 21:00:13 +0100 Subject: [PATCH] Initial deployment --- Procfile | 1 + requirements.txt | Bin 214 -> 496 bytes shorecleanse/settings.py | 22 ++++++++++++++++------ 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..3035110 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn shorecleanse.wsgi \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3bcda381b2bf2607010687be900a040667dcce4b..cc4775c1f18f5f3515cb398022ff720ba78b3a3d 100644 GIT binary patch literal 496 zcmYL`U2eiK5QOKsQjd}-F;LWpzHtDq5dPbuB*bZ=B$8MykLVbWc*j?Su0kgGQ$r$j@AciOIBh1g8B+InT=1UCgqqtXya){ zPK{rCH(bfPFiW(j`%`~lM@Q~A-AA?3mS*p{Ta&h?q8oU@$&@gqYng4${>pb&N^yek zoG42Yj{F*&eO5Y?a*c$DKYO(74nu#AcPi%25piO_oI1~HOsYvtt>{T;=_7wl;lkN! r7Lj|JL^M@;y+g{?QE2X~!P5w#= delta 17 Ycmeyse2sB}(!?OS$wG_@lS3HG06D4!q5uE@ diff --git a/shorecleanse/settings.py b/shorecleanse/settings.py index 0d7e6d1..3bbbfa3 100644 --- a/shorecleanse/settings.py +++ b/shorecleanse/settings.py @@ -11,7 +11,11 @@ """ from pathlib import Path +import os +import dj_database_url +if os.path.isfile('env.py'): + import env # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -20,7 +24,7 @@ # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-f4crd!iydg1(ha&q0gyt-%87cls5m%_i8e@)+)meh)4fnnikad' +SECRET_KEY = os.environ.get('SECRET_KEY', '') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -74,12 +78,18 @@ # Database # https://docs.djangoproject.com/en/4.2/ref/settings/#databases -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + +if 'DATABASE_URL' in os.environ: + DATABASES = { + 'default': dj_database_url.parse(os.environ.get('DATABASE_URL')) + } +else: + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } } -} # Password validation