mirror of
https://github.com/gavanfantom/jlc-chart.git
synced 2026-09-13 16:20:54 +01:00
21 lines
538 B
Python
21 lines
538 B
Python
"""Flask configuration."""
|
|
|
|
from os import environ, path
|
|
from dotenv import load_dotenv
|
|
import secrets
|
|
|
|
basedir = path.abspath(path.dirname(__file__))
|
|
dotfile = path.join(basedir, '.env')
|
|
|
|
# Let's make this as easy as possible to deploy, shall we?
|
|
if not os.path.exists(dotfile):
|
|
with open(dotfile, 'w') as f:
|
|
f.write("SECRET_KEY = '{}'".format(secrets.token_urlsafe(16)))
|
|
|
|
load_dotenv(dotfile)
|
|
|
|
# For development, you know what to do
|
|
#FLASK_ENV = 'development'
|
|
FLASK_ENV = 'production'
|
|
SECRET_KEY = environ.get('SECRET_KEY')
|