Commit dfe5cd4e authored by Lukas Böhm's avatar Lukas Böhm
Browse files

use env file

parent 8a54bab5
......@@ -8,3 +8,5 @@ __pychache__/
home.db
media/
data/
.env
......@@ -3,6 +3,9 @@ from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from redis import Redis
from rq import Queue
from dotenv import load_dotenv
load_dotenv()
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
datadir = os.path.abspath(os.path.join(basedir, 'data'))
......@@ -13,7 +16,6 @@ app.config['SECRET_KEY'] = os.getenv('SECRET_KEY') or 'jonas ist ein kek'
app.config['MEDIA_LOCATION'] = os.getenv('MEDIA_LOCATION') or os.path.join(datadir, 'media')
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URI') or 'sqlite:///' + os.path.join(datadir, 'home.db')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['MAX_CONTENT_LENGTH'] = 500 * 1024 * 1024 # 5 MB
app.config['REDIS_URI'] = os.getenv('REDIS_URI') or 'redis://'
app.jinja_env.globals['len'] = len
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment