diff --git a/intex/intex/settings.py b/intex/intex/settings.py index 7faefd8..717a7f3 100644 --- a/intex/intex/settings.py +++ b/intex/intex/settings.py @@ -13,21 +13,24 @@ from pathlib import Path import os from getpass import getpass +from dotenv import load_dotenv +import dj_database_url # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent - +load_dotenv(os.path.join(BASE_DIR, ".env")) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-d_=5s(h(+q7%4$pkd0&(pr*w9=ml702ff2phs+5sf214w1jav_' +SECRET_KEY = os.getenv("SECRET_KEY") + # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["*"] # Application definition @@ -53,6 +56,7 @@ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', ] ROOT_URLCONF = 'intex.urls' @@ -79,15 +83,10 @@ # Database # https://docs.djangoproject.com/en/4.1/ref/settings/#databases +DATABASE_URL = os.getenv("DATABASE_URL") DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'kidneyfoundation', - 'USER': 'postgres', - 'PASSWORD': 'postgres', - 'HOST': 'localhost', - } + "default": dj_database_url.config(default=DATABASE_URL, conn_max_age=1800), } # Password validation @@ -123,7 +122,7 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.1/howto/static-files/ - +DISABLE_COLLECTSTATIC = 0 STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/' STATICFILES_DIRS = [ @@ -134,3 +133,4 @@ # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + diff --git a/intex/kidneyfoundation/migrations/0003_alter_entry_time.py b/intex/kidneyfoundation/migrations/0003_alter_entry_time.py new file mode 100644 index 0000000..3275dac --- /dev/null +++ b/intex/kidneyfoundation/migrations/0003_alter_entry_time.py @@ -0,0 +1,19 @@ +# Generated by Django 4.1.3 on 2022-12-02 01:32 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('kidneyfoundation', '0002_alter_entry_time'), + ] + + operations = [ + migrations.AlterField( + model_name='entry', + name='time', + field=models.TimeField(default=datetime.time(18, 32, 57, 816671)), + ), + ]