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
+32 -14

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 # Environment variables
.env .env
.env.local .env.*
.env.development.local !.env.example
.env.test.local
.env.production.local
+17 -10
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 For the full list of settings and their values, see
https://docs.djangoproject.com/en/6.0/ref/settings/ https://docs.djangoproject.com/en/6.0/ref/settings/
""" """
from pathlib import Path from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
@@ -147,16 +148,22 @@ CORS_ALLOWED_ORIGINS = [
"http://127.0.0.1:5173", "http://127.0.0.1:5173",
] ]
import os
# ... (near top of file)
# Email (SMTP) # Email (SMTP)
# For development, print to console. # For production, set these via environment variables.
# In production, set these via environment variables. # For development, it will default to printing emails to the console.
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_HOST = os.environ.get('EMAIL_HOST')
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_PORT = int(os.environ.get('EMAIL_PORT', 587))
# EMAIL_HOST = 'smtp.example.com' EMAIL_USE_TLS = os.environ.get('EMAIL_USE_TLS', 'true').lower() == 'true'
# EMAIL_PORT = 587 EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
# EMAIL_USE_TLS = True EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
# EMAIL_HOST_USER = 'user'
# EMAIL_HOST_PASSWORD = 'password' if EMAIL_HOST:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
else:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Swagger # Swagger
SPECTACULAR_SETTINGS = { SPECTACULAR_SETTINGS = {
+2
View File
@@ -6,6 +6,8 @@ services:
context: ./backend context: ./backend
ports: ports:
- "8000:8000" - "8000:8000"
env_file:
- ./.env
volumes: volumes:
- ./backend:/app - ./backend:/app
environment: environment: