mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-06 12:43:18 +00:00
Merge base templates. Add database support. Add blueprint for main.
This commit is contained in:
@ -1,5 +1,13 @@
|
||||
from config import config
|
||||
from flask import Flask, render_template
|
||||
from flask import Flask
|
||||
from flask_login import LoginManager
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
||||
login_manager = LoginManager()
|
||||
login_manager.login_view = 'auth.login'
|
||||
|
||||
|
||||
def create_app(config_name):
|
||||
@ -7,11 +15,13 @@ def create_app(config_name):
|
||||
app.config.from_object(config[config_name])
|
||||
config[config_name].init_app(app)
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('base.html.j2')
|
||||
db.init_app(app)
|
||||
login_manager.init_app(app)
|
||||
|
||||
from .auth import auth as auth_blueprint
|
||||
app.register_blueprint(auth_blueprint, url_prefix='/auth')
|
||||
|
||||
from .main import main as main_blueprint
|
||||
app.register_blueprint(main_blueprint)
|
||||
|
||||
return app
|
||||
|
Reference in New Issue
Block a user