added .env file

This commit is contained in:
nvrl committed 2026-02-15 21:29:07 +01:00
1 parent b634b050e5
commit 96b97e0401
4 files changed
+31 -13

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
# Example SMTP Configuration for Holy Flavors
# Rename this file to .env and fill in your details to enable email sending.
# --- Required for SMTP ---
EMAIL_HOST=smtp.example.com
EMAIL_PORT=587
EMAIL_HOST_USER=your-email@example.com
EMAIL_HOST_PASSWORD=your-app-password
# --- Optional (defaults are usually fine) ---
# EMAIL_USE_TLS=true
+2 -4
View File
@@ -36,7 +36,5 @@ Thumbs.db
# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.*
!.env.example
+16 -9
View File
@@ -9,8 +9,9 @@ https://docs.djangoproject.com/en/6.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/6.0/ref/settings/
"""
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@@ -147,16 +148,22 @@ CORS_ALLOWED_ORIGINS = [
"http://127.0.0.1:5173",
]
import os
# ... (near top of file)
# Email (SMTP)
# For development, print to console.
# In production, set these via environment variables.
# For production, set these via environment variables.
# For development, it will default to printing emails to the console.
EMAIL_HOST = os.environ.get('EMAIL_HOST')
EMAIL_PORT = int(os.environ.get('EMAIL_PORT', 587))
EMAIL_USE_TLS = os.environ.get('EMAIL_USE_TLS', 'true').lower() == 'true'
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
if EMAIL_HOST:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
else:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_HOST = 'smtp.example.com'
# EMAIL_PORT = 587
# EMAIL_USE_TLS = True
# EMAIL_HOST_USER = 'user'
# EMAIL_HOST_PASSWORD = 'password'
# Swagger
SPECTACULAR_SETTINGS = {
+2
View File
@@ -6,6 +6,8 @@ services:
context: ./backend
ports:
- "8000:8000"
env_file:
- ./.env
volumes:
- ./backend:/app
environment: