Produce charts of component availability at JLCPCB from a BOM
Mirrored from https://github.com/gavanfantom/jlc-chart
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
538 B
21 lines
538 B
3 years ago
|
"""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')
|