Initialize the flask app with a random static path, to avoid issue where /static doesn't work in website mode

This commit is contained in:
Micah Lee 2019-10-13 09:55:36 -07:00
parent cc2cead50b
commit 8f1e09875b
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -68,6 +68,9 @@ class Web:
self.app = Flask(
__name__,
static_folder=self.common.get_resource_path("static"),
static_url_path="/static_".format(
self.common.random_string(16)
), # randomize static_url_path to avoid making /static unusable
template_folder=self.common.get_resource_path("templates"),
)
self.app.secret_key = self.common.random_string(8)