partitioncloud-server/partitioncloud/__init__.py

31 lines
619 B
Python
Raw Normal View History

2022-08-13 23:36:10 +02:00
#!/usr/bin/python3
"""
Main file
"""
import os
from flask import Flask, render_template, request, send_file, g, redirect
from . import auth, albums
2022-08-13 23:36:10 +02:00
app = Flask(__name__)
app.config.from_mapping(
# a default secret that should be overridden by instance config
SECRET_KEY="dev",
# store the database in the instance folder
DATABASE=os.path.join(app.instance_path, f"{__name__}.sqlite"),
)
app.register_blueprint(auth.bp)
app.register_blueprint(albums.bp)
@app.route("/")
def home():
"""Redirect to home"""
return redirect("/albums/")
if __name__ == "__main__":
app.run(host="0.0.0.0")