Skip to content

Commit

Permalink
env variable using python-decouple package
Browse files Browse the repository at this point in the history
  • Loading branch information
withrvr committed Jun 16, 2021
1 parent 9a23204 commit 5b85a06
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .env_file
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SECRET_KEY=
DEBUG=

EMAIL_BACKEND=

EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
4 changes: 2 additions & 2 deletions Developer_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ python .\manage.py migrate --fake
python .\manage.py runserver
</pre>

# Install
# [Install this pip packages](./requirements.txt)

- [Install this pip packages](./requirements.txt)
# [make .env file with key and value](./.env_file)
27 changes: 13 additions & 14 deletions OneLink/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
https://docs.djangoproject.com/en/3.1/ref/settings/
"""

# import secret_details
from decouple import config
from django.contrib.messages import constants as messages
from pathlib import Path
import os
Expand All @@ -24,11 +24,10 @@
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get('ONELINK_SECRET_KEY')
SECRET_KEY = config('SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = (os.environ.get('ONELINK_DEBUG_VALUE') == 'True')
DEBUG = True
DEBUG = config('DEBUG', cast=bool)


ALLOWED_HOSTS = [
Expand Down Expand Up @@ -180,17 +179,17 @@
}


# password reset using console ( Testing purpose )
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# testing:- django.core.mail.backends.console.EmailBackend
# or
# production:- django.core.mail.backends.smtp.EmailBackend


# # password reset using gmail account
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_HOST = 'smtp.gmail.com'
# EMAIL_PORT = 587
# EMAIL_USE_TLS = True
# EMAIL_HOST_USER = os.environ.get()
# EMAIL_HOST_PASSWORD = os.environ.get()
# password reset using gmail account
EMAIL_BACKEND = config('EMAIL_BACKEND')
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = config('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')

# django-extensions ... graph_models
GRAPH_MODELS = {
Expand Down
Binary file modified requirements.txt
Binary file not shown.
8 changes: 0 additions & 8 deletions venv_config_vars.md

This file was deleted.

0 comments on commit 5b85a06

Please sign in to comment.