warm.py 385 Bytes
import os
import sys

PROJECT_ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

sys.path.append(PROJECT_ROOT_DIR)

# activate_this = os.path.join(ROOT_DIR, 'venv', 'bin', 'activate_this.py')
# execfile(activate_this, dict(__file__=activate_this))

from web.run import app, cache_warmup

with app.test_request_context('/cache/warmup', data={}):
    cache_warmup()