From 5076150c1c2ca1373a250fb13316c8216d1b8f6d Mon Sep 17 00:00:00 2001 From: pratham1002 <54350608+pratham1002@users.noreply.github.com> Date: Thu, 2 Jan 2020 16:44:09 +0530 Subject: [PATCH 1/2] Update settings.py --- main/settings.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/main/settings.py b/main/settings.py index b2af8dd..8e1d8df 100644 --- a/main/settings.py +++ b/main/settings.py @@ -1,7 +1,7 @@ """ Django settings for main project. -Generated by 'django-admin startproject' using Django 3.0.1. +Generated by 'django-admin startproject' using Django 3.0. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ @@ -11,6 +11,7 @@ """ import os +#import django_heroku import dj_database_url # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -21,12 +22,14 @@ # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '4g$9)iy_(%kvx)f$ty4%=^0vlqr61j1127f9p66^x57#hv(0%o' +SECRET_KEY = 'u*^vbignq_#caps9rl*kw-x9g^f73yzxa7+th)mi+gnojp!kr_' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['.herokuapp.com'] +ALLOWED_HOSTS = ['bitspilanirandommatch.herokuapp.com', + '.pythonanywhere.com' + ] # Application definition @@ -38,7 +41,9 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'django.contrib.postgres', 'timetable', + #'useraccounts.apps.UseraccountsConfig' ] MIDDLEWARE = [ @@ -79,7 +84,7 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'TimeTable', + 'NAME': 'RandomMatch', 'USER': 'postgres', 'PASSWORD': 'pratham123', 'HOST': 'localhost', @@ -134,5 +139,13 @@ # Add configuration for static files storage using whitenoise STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' +EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend' +EMAIL_HOST = 'smtp.gmail.com' +EMAIL_USE_TLS = True +EMAIL_PORT = 587 +EMAIL_HOST_USER = 'gen.bitsian.guy@gmail.com' +EMAIL_HOST_PASSWORD = 'pratham123' + prod_db = dj_database_url.config(conn_max_age=500) -DATABASES['default'].update(prod_db) \ No newline at end of file +DATABASES['default'].update(prod_db) +#django_heroku.settings(locals()) From 497cc3aa17407bbdfdf1a2b5bbeb12174c455b80 Mon Sep 17 00:00:00 2001 From: pratham1002 <54350608+pratham1002@users.noreply.github.com> Date: Thu, 2 Jan 2020 16:46:28 +0530 Subject: [PATCH 2/2] Update settings.py --- main/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/settings.py b/main/settings.py index 8e1d8df..9c770cb 100644 --- a/main/settings.py +++ b/main/settings.py @@ -27,7 +27,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['bitspilanirandommatch.herokuapp.com', +ALLOWED_HOSTS = ['.herokuapp.com', '.pythonanywhere.com' ]