From a8dc175591dd430304120fed5342e764555bfea3 Mon Sep 17 00:00:00 2001 From: slabia Date: Wed, 27 Oct 2021 10:55:55 +0100 Subject: [PATCH] mix fix for the email --- .env | 15 +++++++++++++++ .gitignore | 2 +- aliss/templates/account/password_reset.html | 2 +- config/settings/production.py | 7 ++++++- requirements.txt | 3 ++- 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 000000000..9d13a1967 --- /dev/null +++ b/.env @@ -0,0 +1,15 @@ +DJANGO_SETTINGS_MODULE='config.settings.local' +DATABASE_URL='postgresql://localhost/alissproject' +SECRET_KEY='thisisasecrectkey' +ALLOWED_HOSTS='localhost,www.localhost,127.0.0.1' +ELASTICSEARCH_URL=http://localhost:9200 +ELASTICSEARCH_USERNAME='' +ELASTICSEARCH_PASSWORD='' +GOOGLE_API_KEY='secretinit' +CLOUDINARY_CLOUD_NAME='test' +CLOUDINARY_API_KEY='test' +CLOUDINARY_API_SECRET='test' +CLOUDINARY_URL='cloudinary://x:y@z' +ANALYTICS_ID='' +SECRET_KEY=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 + diff --git a/.gitignore b/.gitignore index 78f38a77d..26a99243a 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,7 @@ target/ .DS_Store #App Specific -.env + staticfiles/ #Node + Gulp diff --git a/aliss/templates/account/password_reset.html b/aliss/templates/account/password_reset.html index 5e2c09351..1e6bfedd5 100644 --- a/aliss/templates/account/password_reset.html +++ b/aliss/templates/account/password_reset.html @@ -40,7 +40,7 @@

Reset your password

document.getElementById("Check").style.display = "none"; function DoSubmit(){ - if(document.getElementById("Check").value.length == 0) + if(document.getElementById("Check").value.length != 0) { alert("Only registered user are able to send a request"); } diff --git a/config/settings/production.py b/config/settings/production.py index be8d46d7e..94249b979 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -1,7 +1,12 @@ from .base import * +import environ + DEBUG = False +env = environ.Env() +environ.Env.read_env() + # Elasticsearch ELASTICSEARCH_URL = os.environ.get('FOUNDELASTICSEARCH_URL') ELASTICSEARCH_USERNAME = os.environ.get('ELASTICSEARCH_USERNAME', '') @@ -17,6 +22,6 @@ EMAIL_HOST= 'smtp.sendgrid.net' EMAIL_PORT = 587 EMAIL_USE_TLS = True -EMAIL_HOST_PASSWORD = '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' +EMAIL_HOST_PASSWORD = env('SECRET_KEY') SECURE_SSL_REDIRECT = True diff --git a/requirements.txt b/requirements.txt index 5b377ee10..67b8fccbb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,4 +18,5 @@ cloudinary==1.14.0 requests>=2.22.0 Shapely>=1.6.4.post2 django-google-analytics-app==4.4.0 -django-admin-bootstrapped>=1.6.4 \ No newline at end of file +django-admin-bootstrapped>=1.6.4 +django-environ \ No newline at end of file