mastodon-BDSM/BDSM/__init__.py

25 lines
708 B
Python
Raw Permalink Normal View History

2022-09-18 05:23:33 +02:00
#!/usr/bin/env python3
import os
import sys
from flask import Flask, flash
from flask_sqlalchemy import SQLAlchemy
# SQLite URI compatible
WIN = sys.platform.startswith('win')
if WIN:
prefix = 'sqlite:///'
else:
prefix = 'sqlite:////'
app = Flask(__name__)
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'dev')
2023-05-09 11:19:16 +02:00
app.config['SQLALCHEMY_DATABASE_URI'] = prefix + os.path.join(os.path.dirname(app.root_path),
"data",
os.getenv('DATABASE_FILE', 'data.db'))
2022-09-18 05:23:33 +02:00
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
from BDSM import views, models, commands