Netdeploy2 Babyyyy
This commit is contained in:
28
app.py
Normal file
28
app.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from flask import Flask, redirect, url_for
|
||||
from extensions import db, migrate
|
||||
from routes.clients import bp as clients_bp
|
||||
from routes.quotes import bp as quotes_bp
|
||||
from routes.invoices import bp as invoices_bp
|
||||
from models import *
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///quotes.db"
|
||||
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
|
||||
app.secret_key = "dev-secret"
|
||||
|
||||
db.init_app(app)
|
||||
migrate.init_app(app, db)
|
||||
|
||||
app.register_blueprint(clients_bp)
|
||||
app.register_blueprint(quotes_bp)
|
||||
app.register_blueprint(invoices_bp)
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return redirect(url_for("quotes.dashboard"))
|
||||
|
||||
return app
|
||||
|
||||
if __name__ == "__main__":
|
||||
create_app().run(debug=True, use_reloader=False)
|
||||
Reference in New Issue
Block a user