Fix config.py.

Default to .env DATABASE_URL, fallback to DATABASE_URL on app.db
This commit is contained in:
pluja 2020-09-08 12:30:43 +02:00
parent d665a8649f
commit cd7fa8e233

View File

@ -1,6 +1,8 @@
import os import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__)) basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object): class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess' SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'