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 3bcda38..cc4775c 100644 Binary files a/requirements.txt and b/requirements.txt differ 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