Commit 21ce085c authored by Pietro Albini's avatar Pietro Albini

Always put /+assets in the cache

parent f1b74f6a
......@@ -41,6 +41,23 @@ def run(cache, gunicorn_config, port, public, workers, debug):
app = uitwww.create_app(cache)
app.wsgi_app = utils.ReverseProxied(app.wsgi_app)
src_directory = os.path.dirname(os.path.abspath(__file__))
# Link static assets to the cache directory, if it's enabled
static_dirs = {"static": "+assets"}
if cache is not None:
if not os.path.exists(cache):
for src, dest in static_dirs.items():
dest = os.path.join(cache, dest)
# The destinationa already exists
if os.path.exists(dest):
os.symlink(os.path.join(src_directory, src), dest)
host = ""
if public:
host = ""
......@@ -48,7 +65,7 @@ def run(cache, gunicorn_config, port, public, workers, debug):
# In debug mode, run the flask builtin webserver
if debug:
extra_files = [
os.path.join(os.path.dirname(__file__), "navbar.json"),
os.path.join(src_directory, "navbar.json"),
], port=port, host=host, extra_files=extra_files)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment