Set static path relative to codebase.

This help a Guix package to locate the basic static assets.
This commit is contained in:
Ben Sturmfels
2021-09-17 22:57:53 +10:00
parent af09b76392
commit f620b65e05
2 changed files with 3 additions and 1 deletions

View File

@@ -362,6 +362,9 @@ def paste_app_factory(global_config, **app_config):
raise OSError("Usable mediagoblin config not found.")
del app_config['config']
# Set static path relative to code to simplify Guix packaging.
app_config['/mgoblin_static'] = os.path.join(os.path.dirname(__file__), 'static')
mgoblin_app = MediaGoblinApp(mediagoblin_config)
mgoblin_app.call_backend = SharedDataMiddleware(mgoblin_app.call_backend,
exports=app_config)