Exemple #1
0
 def decorated_function(*args, **kwargs):
     ''' Gets called in place of handler '''
     session = get_session()
     if not 'nonce' in session:
         session['nonce'] = new_key()
     resp = make_response(handle(*args, **kwargs))
     app.save_session(session, resp)
     return resp
Exemple #2
0
# Maximum number of neutrons allowed (ray samples / ncount)
MAX_RAY_SAMPLES = 10000000

# Maximum number of scan points allowed (npoints)
MAX_SCAN_POINTS = 1000


# Extra datafiles/directories needed by the simulations
# (implemented with soft/symbolic linking before running a simulation)
DATA_FILES = []

# The line below would create a link in the simulation folder
# named 'datafiles' to the path in 'sim/datafiles'
# (relative to the webapp folder)
# DATA_FILES = ['sim/datafiles']


# Generate a key for signing cookies (resets when server is restartet)
SECRET_KEY = new_key()

# Enable protection against cross-site request forgery in WTF
# (not currently needed, util.py does this with nonce)
CSRF_ENABLED = True
CSRF_SESSION_KEY = new_key()


# Cache templates in-memory
CACHE_TYPE = "simple"
CACHE_THRESHOLD = 20  # object size
CACHE_DEFAULT_TIMEOUT = 30  # seconds
Exemple #3
0
# Set URL path for static files (e.g. /static/jquery.js)
STATIC_PATH = '/static'

# Maximum number of neutrons allowed (ray samples / ncount)
MAX_RAY_SAMPLES = 10000000

# Maximum number of scan points allowed (npoints)
MAX_SCAN_POINTS = 1000

# Extra datafiles/directories needed by the simulations
# (implemented with soft/symbolic linking before running a simulation)
DATA_FILES = []

# The line below would create a link in the simulation folder
# named 'datafiles' to the path in 'sim/datafiles'
# (relative to the webapp folder)
# DATA_FILES = ['sim/datafiles']

# Generate a key for signing cookies (resets when server is restartet)
SECRET_KEY = new_key()

# Enable protection against cross-site request forgery in WTF
# (not currently needed, util.py does this with nonce)
CSRF_ENABLED = True
CSRF_SESSION_KEY = new_key()

# Cache templates in-memory
CACHE_TYPE = 'simple'
CACHE_THRESHOLD = 20  # object size
CACHE_DEFAULT_TIMEOUT = 30  # seconds