From 792f0071e37e20d89fda1a12fdee5f75af98892b Mon Sep 17 00:00:00 2001 From: Bashar Zheiman Date: Wed, 3 Apr 2024 21:24:07 +0000 Subject: [PATCH] Hide secret_key & fix some bugs --- .env | 1 + restaurant_booking_system/settings.py | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..d674723 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +DATABASE_URL=postgres://bvrgtfij:q09uqZAMdTqkrT6JPi0URnXzTShiEZFJ@heffalump.db.elephantsql.com/bvrgtfij \ No newline at end of file diff --git a/restaurant_booking_system/settings.py b/restaurant_booking_system/settings.py index 7fa547a..d00b580 100644 --- a/restaurant_booking_system/settings.py +++ b/restaurant_booking_system/settings.py @@ -27,12 +27,12 @@ # 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-lo_ku^_ng8lfke_0w$$nf4l3mr$$whtp#@+8$-y!jvuc&r-0ii' +SECRET_KEY = os.getenv('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = True -ALLOWED_HOSTS = ['8000-bashmdz-restaurantbooki-p2d7q6lyrga.ws-us107.gitpod.io','.herokuapp.com' +ALLOWED_HOSTS = ['8000-bashmdz-houseofdamascus-neozn7p2zte.ws-us110.gitpod.io','.herokuapp.com' ] @@ -94,15 +94,16 @@ # Database # https://docs.djangoproject.com/en/4.2/ref/settings/#databases +DATABASE_URL = os.getenv('DATABASE_URL') DATABASES = { - 'default': dj_database_url.parse(os.environ.get("DATABASE_URL")) + 'default': dj_database_url.parse(DATABASE_URL), } if 'test' in sys.argv: DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3' CSRF_TRUSTED_ORIGINS = [ - "https://8000-bashmdz-restaurantbooki-p2d7q6lyrga.ws-us107.gitpod.io", + "https://8000-bashmdz-houseofdamascus-neozn7p2zte.ws-us110.gitpod.io", "https://my-restaurant-booking-system-38d3a97041b0.herokuapp.com" ]