mirror of
https://github.com/partitioncloud/partitioncloud-server.git
synced 2025-02-02 13:49:40 +01:00
31 lines
619 B
Python
31 lines
619 B
Python
|
#!/usr/bin/python3
|
||
|
"""
|
||
|
Main file
|
||
|
"""
|
||
|
import os
|
||
|
from flask import Flask, render_template, request, send_file, g, redirect
|
||
|
|
||
|
from . import auth, albums
|
||
|
|
||
|
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")
|