Exemple #1
0
def subdomain(directory):
    app = Flask(__name__, static_folder=directory + "/static")
    set_secret_key(app)
    loader = [app.jinja_loader, jinja2.FileSystemLoader(directory + "/templates")]
    app.jinja_loader = jinja2.ChoiceLoader(loader)
    app.wsgi_app = ProxyFix(app.wsgi_app)
    return app
Exemple #2
0
                 push_notifications_api, study_api, survey_api)
from api.tableau_api.views import SummaryStatisticDailyStudyView
from api.tableau_api.web_data_connector import WebDataConnector
from authentication.admin_authentication import is_logged_in
from config.settings import SENTRY_ELASTIC_BEANSTALK_DSN, SENTRY_JAVASCRIPT_DSN
from libs.security import set_secret_key
from libs.sentry import normalize_sentry_dsn
from pages import (admin_pages, data_access_web_form, login_pages,
                   mobile_pages, survey_designer, system_admin_pages)

# Flask App
app = Flask(__name__, static_folder="frontend/static")
app.jinja_loader = jinja2.ChoiceLoader(
    [app.jinja_loader,
     jinja2.FileSystemLoader("frontend/templates")])
set_secret_key(app)
app.wsgi_app = ProxyFix(app.wsgi_app)

CORS(app)

# Flask Blueprints
app.register_blueprint(login_pages.login_pages)
app.register_blueprint(mobile_api.mobile_api)
app.register_blueprint(admin_pages.admin_pages)
app.register_blueprint(mobile_pages.mobile_pages)
app.register_blueprint(system_admin_pages.system_admin_pages)
app.register_blueprint(survey_designer.survey_designer)
app.register_blueprint(admin_api.admin_api)
app.register_blueprint(participant_administration.participant_administration)
app.register_blueprint(survey_api.survey_api)
app.register_blueprint(study_api.study_api)