Prepare for deploy
This commit is contained in:
parent
3ccf65b8e5
commit
9afa7f928f
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
db.sqlite3
|
||||
media/
|
||||
.env
|
@ -11,6 +11,10 @@ https://docs.djangoproject.com/en/3.2/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,12 +24,17 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-d&9*2#r2_)aaskh23)tpu!#jyu*e2yyw0ajg-2@25444^5$eov'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['*', 'puchar.lo5.bielsko.pl', 'localhost', '127.0.0.1']
|
||||
SECRET_KEY = os.getenv('SECRET_KEY')
|
||||
EMAIL_BACKEND = os.getenv('EMAIL_BACKEND')
|
||||
EMAIL_HOST = os.getenv('EMAIL_HOST')
|
||||
EMAIL_USE_TLS = True
|
||||
EMAIL_USE_SSL = False
|
||||
EMAIL_PORT = int(os.getenv('EMAIL_PORT'))
|
||||
EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER')
|
||||
EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD')
|
||||
DEBUG = int(os.getenv('DEBUG')) == 1
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
|
||||
# Application definition
|
||||
@ -80,8 +89,11 @@ X_FRAME_OPTIONS = 'SAMEORIGIN'
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3'
|
||||
'ENGINE': os.getenv('DB_ENGINE'),
|
||||
'NAME': os.getenv('DB_NAME'),
|
||||
'HOST': os.getenv('DB_HOST'),
|
||||
'USER': os.getenv('DB_USER'),
|
||||
'PASSWORD': os.getenv('DB_PASSWORD'),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,3 +3,5 @@ django-cleanup
|
||||
django-crispy-forms==1.12.0
|
||||
django-summernote
|
||||
django-crispy-bulma
|
||||
|
||||
python-dotenv
|
||||
|
Loading…
Reference in New Issue
Block a user