Refactored static file handling so that extensions can provide static files

This commit is contained in:
2016-09-07 16:36:25 +02:00
parent b2e8711ac4
commit 9e6b998c50
3 changed files with 40 additions and 12 deletions

View File

@@ -72,5 +72,17 @@ class PillarExtension(object):
"""
return None
@property
def static_path(self):
"""Returns the path where static files are stored.
Registers an endpoint named 'static_<extension name>', to use like:
`url_for('static_attract', filename='js/somefile.js')`
May return None, in which case the extension will not be able to serve
static files.
"""
return None
def setup_app(self, app):
"""Called during app startup, after all extensions have loaded."""