Set blueprint paths in main app
Make blueprints more self-contained for no apparent reason.
This commit is contained in:
parent
abc7a0728b
commit
32b182856d
|
@ -48,19 +48,19 @@ def create_app(test_config=None):
|
||||||
system.init_app(app)
|
system.init_app(app)
|
||||||
|
|
||||||
from . import config
|
from . import config
|
||||||
app.register_blueprint(config.blueprint)
|
app.register_blueprint(config.blueprint, url_prefix='/config')
|
||||||
|
|
||||||
from . import ipsets
|
from . import ipsets
|
||||||
app.register_blueprint(ipsets.blueprint)
|
app.register_blueprint(ipsets.blueprint, url_prefix='/ipsets')
|
||||||
|
|
||||||
from . import nat
|
from . import nat
|
||||||
app.register_blueprint(nat.blueprint)
|
app.register_blueprint(nat.blueprint, url_prefix='/nat')
|
||||||
|
|
||||||
from . import rules
|
from . import rules
|
||||||
app.register_blueprint(rules.blueprint)
|
app.register_blueprint(rules.blueprint, url_prefix='/rules')
|
||||||
|
|
||||||
from . import vpn
|
from . import vpn
|
||||||
app.register_blueprint(vpn.blueprint)
|
app.register_blueprint(vpn.blueprint, url_prefix='/vpn')
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
@flask_login.login_required
|
@flask_login.login_required
|
||||||
|
|
|
@ -6,7 +6,7 @@ import flask_login
|
||||||
from . import db
|
from . import db
|
||||||
from . import system
|
from . import system
|
||||||
|
|
||||||
blueprint = flask.Blueprint('config', __name__, url_prefix='/config')
|
blueprint = flask.Blueprint('config', __name__)
|
||||||
|
|
||||||
@blueprint.route('/', methods=('GET', 'POST'))
|
@blueprint.route('/', methods=('GET', 'POST'))
|
||||||
@flask_login.login_required
|
@flask_login.login_required
|
||||||
|
|
|
@ -6,7 +6,7 @@ import flask_login
|
||||||
from . import db
|
from . import db
|
||||||
from . import system
|
from . import system
|
||||||
|
|
||||||
blueprint = flask.Blueprint('ipsets', __name__, url_prefix='/ipsets')
|
blueprint = flask.Blueprint('ipsets', __name__)
|
||||||
|
|
||||||
@blueprint.route('/', methods=('GET', 'POST'))
|
@blueprint.route('/', methods=('GET', 'POST'))
|
||||||
@flask_login.login_required
|
@flask_login.login_required
|
||||||
|
|
|
@ -4,7 +4,7 @@ import flask_login
|
||||||
from . import db
|
from . import db
|
||||||
from . import system
|
from . import system
|
||||||
|
|
||||||
blueprint = flask.Blueprint('nat', __name__, url_prefix='/nat')
|
blueprint = flask.Blueprint('nat', __name__)
|
||||||
|
|
||||||
@blueprint.route('/', methods=('GET', 'POST'))
|
@blueprint.route('/', methods=('GET', 'POST'))
|
||||||
@flask_login.login_required
|
@flask_login.login_required
|
||||||
|
|
|
@ -4,7 +4,7 @@ import flask_login
|
||||||
from . import db
|
from . import db
|
||||||
from . import system
|
from . import system
|
||||||
|
|
||||||
blueprint = flask.Blueprint('rules', __name__, url_prefix='/rules')
|
blueprint = flask.Blueprint('rules', __name__)
|
||||||
|
|
||||||
@blueprint.route('/', methods=('GET', 'POST'))
|
@blueprint.route('/', methods=('GET', 'POST'))
|
||||||
@flask_login.login_required
|
@flask_login.login_required
|
||||||
|
|
|
@ -10,7 +10,7 @@ import flask_login
|
||||||
from . import db
|
from . import db
|
||||||
from . import system
|
from . import system
|
||||||
|
|
||||||
blueprint = flask.Blueprint('vpn', __name__, url_prefix='/vpn')
|
blueprint = flask.Blueprint('vpn', __name__)
|
||||||
wgkey_regex = re.compile(r'^[A-Za-z0-9/+=]{44}$')
|
wgkey_regex = re.compile(r'^[A-Za-z0-9/+=]{44}$')
|
||||||
|
|
||||||
@blueprint.route('/')
|
@blueprint.route('/')
|
||||||
|
|
Loading…
Reference in a new issue