blob: 3d8d5c76015f9cc19aaf09b69a13fe5c13cd03d6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
from secrets import token_hex
from flask import Flask
from os import getenv
from db_actions import db
app = Flask(__name__, static_url_path='')
if db_uri := getenv("SQLALCHEMY_DATABASE_URI"):
app.config["SQLALCHEMY_DATABASE_URI"]=db_uri
else:
app.config["SQLALCHEMY_DATABASE_URI"]="postgresql:///"
if s_key := getenv("SECRET_KEY"):
app.secret_key = s_key
else:
app.secret_key = token_hex()
db.init_app(app)
import routes.base
import routes.answer
import routes.create
import routes.analyse
import routes.question
|