1
0
forked from ScoDoc/ScoDoc

mail on localhost by default

This commit is contained in:
Emmanuel Viennet 2021-08-27 10:49:36 +02:00
parent d2947b23d3
commit e14eb723bf
3 changed files with 5 additions and 11 deletions

View File

@ -6,9 +6,8 @@
FLASK_APP=scodoc.py
FLASK_ENV=production # ou "development" si vous développez
# Envois de mails: décommenter et adapter
# Envois de mails: adapter si nécessaire
# MAIL_SERVER=localhost
# MAIL_PORT=25
# Obligatoire:
SCODOC_ADMIN_MAIL="emmanuel@viennet.net"

View File

@ -11,15 +11,13 @@ load_dotenv(os.path.join(BASEDIR, ".env"))
class Config:
"""General configuration. Mostly loaded from environment via .env"""
SQLALCHEMY_DATABASE_URI = None # set in subclass
FLASK_ENV = None # # set in subclass
SECRET_KEY = os.environ.get("SECRET_KEY") or "90e01e75831e4176a3c70d29564b425f"
SQLALCHEMY_DATABASE_URI = (
os.environ.get("USERS_DATABASE_URI")
or "postgresql://scodoc@localhost:5432/SCO8USERS"
)
SQLALCHEMY_TRACK_MODIFICATIONS = False
LOG_TO_STDOUT = os.environ.get("LOG_TO_STDOUT")
MAIL_SERVER = os.environ.get("MAIL_SERVER")
MAIL_PORT = int(os.environ.get("MAIL_PORT") or 25)
MAIL_SERVER = os.environ.get("MAIL_SERVER", "localhost")
MAIL_PORT = int(os.environ.get("MAIL_PORT", 25))
MAIL_USE_TLS = os.environ.get("MAIL_USE_TLS") is not None
MAIL_USERNAME = os.environ.get("MAIL_USERNAME")
MAIL_PASSWORD = os.environ.get("MAIL_PASSWORD")

View File

@ -88,9 +88,6 @@ then
FLASK_APP=scodoc.py
FLASK_ENV=production
MAIL_SERVER=localhost
MAIL_PORT=25
SCODOC_ADMIN_MAIL="$SCODOC_ADMIN_MAIL" # important: le mail de admin
SECRET_KEY="$SECRET_KEY" # une chaine aléatoire"