Move sensitive info to .env file and reset db

This commit is contained in:
Keannu Christian Bernasol 2023-03-10 23:09:20 +08:00
parent 0f317ebbf5
commit 2a9a81d88d
3 changed files with 26 additions and 7 deletions

View file

@ -11,6 +11,10 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
"""
from pathlib import Path
from dotenv import load_dotenv
import os
load_dotenv()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@ -20,8 +24,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# 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-t&s%wwbx-78$qa#&id_+xw8!m3jt35bgukr03e@$v8$-x5q52i'
SECRET_KEY = os.environ.get('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
@ -149,10 +152,17 @@ DJOSER = {
},
}
EMAIL_HOST = 'sandbox.smtp.mailtrap.io'
EMAIL_HOST_USER = '54ff6949e39105'
EMAIL_HOST_PASSWORD = 'c59d3eaa05f98d'
EMAIL_PORT = '2525'
# Mailtrap SMTP Testing
# EMAIL_HOST = 'sandbox.smtp.mailtrap.io'
# EMAIL_HOST_USER = '54ff6949e39105'
# EMAIL_HOST_PASSWORD = 'c59d3eaa05f98d'
# EMAIL_PORT = '2525'
EMAIL_HOST = "smtp.gmail.com"
EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER")
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
EMAIL_PORT = 587
EMAIL_USE_TLS = True
CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",