Initial commit
This commit is contained in:
commit
c0b4ca1021
21 changed files with 677 additions and 0 deletions
23
app/__init__.py
Normal file
23
app/__init__.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from flask import Flask
|
||||
from config import Config
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_migrate import Migrate
|
||||
from flask_login import LoginManager
|
||||
from flask import request
|
||||
from flask_babel import Babel
|
||||
from flask_babel import lazy_gettext as _l
|
||||
|
||||
def get_locale():
|
||||
return request.accept_languages.best_match(app.config['LANGUAGES'])
|
||||
app = Flask(__name__)
|
||||
babel = Babel(app, locale_selector=get_locale)
|
||||
app.config.from_object(Config)
|
||||
db = SQLAlchemy(app)
|
||||
migrate = Migrate(app, db)
|
||||
login = LoginManager(app)
|
||||
login.login_view = 'login'
|
||||
login.login_message = _l('Please log in to access this page.')
|
||||
from app import routes, models
|
||||
|
||||
from app.commands import seed_settings_command
|
||||
app.cli.add_command(seed_settings_command)
|
||||
Loading…
Add table
Add a link
Reference in a new issue