__author__ = 'CHEN Zhao' import time import admin import blueprints from flask_app import app, cache import rest from flask import render_template, request, redirect, jsonify, g from models import * import json app.register_blueprint(blueprints.user_bp, url_prefix='/user') app.register_blueprint(blueprints.image_bp, url_prefix='/image') app.register_blueprint(blueprints.video_bp, url_prefix='/video') app.register_blueprint(blueprints.audio_bp, url_prefix='/audio') # flask_app.register_blueprint(blueprints._bp, url_prefix='/portal') app.register_blueprint(blueprints.shortcut_bp, url_prefix='/shortcut') app.register_blueprint(blueprints.shortcut_sd, url_prefix='/definitions') rest.ReSTManager.init_rest(app) # admin.init_admin() def profile_log(*l): app.profiling_logger.debug(l) @app.route('/')
from error_handling import BaseApiError, InvalidUsage from resources.login import bp as login_bp from resources.company import bp as company_bp from resources.employees import bp as employees_bp from resources.countries import bp as countries_bp from resources.assumptions import bp as assumptions_bp from resources.password_recovery import bp as password_recovery_bp from resources.admin import bp as admin_bp from resources.traveller_data import bp as traveller_data_bp from resources.applications import bp as applications_bp from resources.report_results import bp as report_results_bp from resources.additional_clarifications import bp as additional_clarifications_bp CORS(app, resources={r"/*": {"origins": "*"}}) app.register_blueprint(sse, url_prefix="/stream") app.register_blueprint(login_bp, url_prefix="/login") app.register_blueprint(company_bp, url_prefix="/company") app.register_blueprint(employees_bp, url_prefix="/employees") app.register_blueprint(countries_bp, url_prefix="/countries") app.register_blueprint(assumptions_bp, url_prefix="/assumptions") app.register_blueprint(password_recovery_bp, url_prefix="/password-recovery") app.register_blueprint(admin_bp, url_prefix="/admin") app.register_blueprint(traveller_data_bp, url_prefix="/traveller-data") app.register_blueprint(applications_bp, url_prefix="/applications") app.register_blueprint(report_results_bp, url_prefix="/report-results") app.register_blueprint(additional_clarifications_bp, url_prefix="/additional-clarifications") @app.after_request
from flask_app import app # Initialized in __init__.py from flask_app.routes.click_counter_route import click_counter_bp app.register_blueprint(click_counter_bp) if __name__ == '__main__': app.run(host='localhost', use_reloader=True, port=5000, threaded=True)
""" Make output button on Scans tab prompt for file name instead of default Add a pull down menu or a way to see all the files in the /static/saved_files directory, and select a name, then modify or not up to user. User should be able to just type in a file name too """ # TODO: Fix 'Peak at Point' and 'Fit around Point' options on Scans tab login_manager = LoginManager() login_manager.login_view = 'users.login2' login_manager.login_message_category = 'info' login_manager.init_app(app) userDbApi = UserDbApi() app.register_blueprint(hrmApp) app.register_blueprint(logbookApp) app.register_blueprint(sessions) app.register_blueprint(files) app.register_blueprint(users) app.register_blueprint(a) app.register_blueprint(hrms) app.register_blueprint(dm) """ REMOVE THIS ON SERVER - BEGIN """ @app.before_request def fixURL(): url = request.path
__author__ = 'CHEN Zhao' import time import admin import blueprints from flask_app import app, cache import rest from flask import render_template, request, redirect, jsonify, g from models import * import json app.register_blueprint(blueprints.user_bp, url_prefix='/user') app.register_blueprint(blueprints.image_bp, url_prefix='/image') app.register_blueprint(blueprints.video_bp, url_prefix='/video') app.register_blueprint(blueprints.audio_bp, url_prefix='/audio') app.register_blueprint(blueprints.shortcut_bp, url_prefix='/shortcut') app.register_blueprint(blueprints.shortcut_sd, url_prefix='/definitions') rest.ReSTManager.init_rest(app) admin.init_admin() @app.route('/') def index(): return render_template('index.html', config=app.config) @app.route('/statistic')
from flask import Blueprint from flask_app import app import UpdateManager error_notification = Blueprint("errors", __name__, url_prefix="/error_notification") @error_notification.route('', methods=['GET']) def show_errors(): return UpdateManager.current_image.get_errors() app.register_blueprint(error_notification)
from flask_app import app, bp app.register_blueprint(bp) if __name__ == '__main__': app.run()
from flask_app import app from api.face_api import api from api.static_api import static_api from flask import render_template app.register_blueprint(api, url_prefix='/api/v1') app.register_blueprint(static_api, url_prefix='/') @app.route('/', methods=['GET']) def index(): return render_template('index.html') if __name__ == '__main__': app.run(debug=True, host='0.0.0.0')