Esempio n. 1
0
 def request_check_start():
     if app.start:
         return set_site(app)
     ends = frozenset(["admin.setup", "admin.install", "static"])
     if request.endpoint in ends:
         return
     if not _exist_config(app):
         return redirect(url_for("admin.setup"))
     return redirect(url_for("admin.install"))
Esempio n. 2
0
def check_start(app, db):
    from app.includes.start import _exist_config, exist_table, create_path, set_site
    create_path(app)
    app.start = False
    if _exist_config(app):
        from app.config import Config
        app.config.from_object(Config)
        if exist_table(app):
            app.start = True
            return

    @app.before_request
    def request_check_start():
        if app.start:
            return set_site(app)
        ends = frozenset(["admin.setup", "admin.install", "static"])
        if request.endpoint in ends:
            return
        if not _exist_config(app):
            return redirect(url_for("admin.setup"))
        return redirect(url_for("admin.install"))