Web front enabled basic flask setup
This commit is contained in:
parent
013cc90404
commit
962d611b09
@ -0,0 +1,20 @@
|
|||||||
|
from flask import Flask
|
||||||
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
|
from flask_login import LoginManager
|
||||||
|
|
||||||
|
db = SQLAlchemy()
|
||||||
|
login_manager = LoginManager()
|
||||||
|
|
||||||
|
def create_app():
|
||||||
|
app = Flask(__name__)
|
||||||
|
app.config['SECRET_KEY'] = 'devkey' # Change this for production
|
||||||
|
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///do_tracker.db'
|
||||||
|
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||||
|
|
||||||
|
db.init_app(app)
|
||||||
|
login_manager.init_app(app)
|
||||||
|
|
||||||
|
from .routes import main as main_blueprint
|
||||||
|
app.register_blueprint(main_blueprint)
|
||||||
|
|
||||||
|
return app
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
from flask import Blueprint
|
||||||
|
|
||||||
|
main = Blueprint('main', __name__)
|
||||||
|
|
||||||
|
@main.route("/")
|
||||||
|
def home():
|
||||||
|
return "<h1>DO Tracker Online</h1><p>Welcome to the system.</p>"
|
||||||
Loading…
x
Reference in New Issue
Block a user