Python 3 supports 'namespace packages', and thus can see a directory without __init__.py as something importable. This caused a name conflict, since there were both the file static.py and the dir static.
13 lines
293 B
Python
13 lines
293 B
Python
"""Static file handling"""
|
|
|
|
import flask
|
|
import flask.views
|
|
|
|
|
|
class PillarStaticFile(flask.views.MethodView):
|
|
def __init__(self, static_folder):
|
|
self.static_folder = static_folder
|
|
|
|
def get(self, filename):
|
|
return flask.send_from_directory(self.static_folder, filename)
|