You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When app.yaml has static_dir point to Flask application's static/ directory, os.path.exists will always return False and thus causing _PackageBoundObject.has_static_dir to return False making static URL rule not being added at initialization.
from google.appengine.ext.webapp.util import run_wsgi_app
from flask import Flask
app = Flask(__name__)
@app.route('/')
def demo():
return str(app.has_static_folder)
def main():
run_wsgi_app(app)
if __name__ == '__main__':
main()
This will return False but will return True once I comment out the static handler. Current workaround is to add static rule myself, using app.add_url_rule(app.static_path + '/<path:filename>', endpoint='static') of sort. It would be nice of Flask detects GAE and add the static path anyway.
The text was updated successfully, but these errors were encountered:
The solution is probably to just register the rule anyways. Detecting GAE sounds abit fishy and would change behavior for a specific environment. Unless someone can figure out any reasonable ways to fix that.
When app.yaml has
static_dir
point to Flask application'sstatic/
directory,os.path.exists
will always returnFalse
and thus causing_PackageBoundObject.has_static_dir
to returnFalse
making static URL rule not being added at initialization.Example:
app.yaml
app.py
This will return
False
but will returnTrue
once I comment out the static handler. Current workaround is to add static rule myself, usingapp.add_url_rule(app.static_path + '/<path:filename>', endpoint='static')
of sort. It would be nice of Flask detects GAE and add the static path anyway.The text was updated successfully, but these errors were encountered: