Exemplo n.º 1
0
"""Create experiment as a web application"""

from survey import *
from settings import settings

from hemlock import create_app
from hemlock.app import db, socketio
from hemlock.database.private import DataStore
from hemlock.app.routes.base_routing import create_researcher_navbar

app = create_app(settings)
if __name__ == '__main__':
    socketio.run(app)


@app.shell_context_processor
def make_shell_context():
    db.create_all()
    if not DataStore.query.first():
        DataStore()
    return globals()
Exemplo n.º 2
0
"""Create the application.
"""
from hemlock import create_app
from hemlock.app import socketio

import src

app = create_app()

if app.config["ENV"] == "production":
    # Don't allow users to restart and block duplicate IP addresses in production
    app.config.update(ALLOW_USERS_TO_RESTART=False,
                      BLOCK_DUPLICATE_KEYS=["ipv4"])

if __name__ == "__main__":
    socketio.run(app, debug=True)
Exemplo n.º 3
0
"""Create web application"""

from survey import *

from hemlock import create_app
from hemlock.app import db, socketio
from hemlock.database.private import DataStore

import sys

app = create_app()
    
@app.shell_context_processor
def make_shell_context():
    db.create_all()
    if not DataStore.query.first():
        DataStore()
    return globals()

if __name__ == '__main__':
    socketio.run(app, debug=sys.argv[1]=='True')