Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jacek-jablonski/1ea679c75b6370f44cf56d1f48e725a0 to your computer and use it in GitHub Desktop.
Save jacek-jablonski/1ea679c75b6370f44cf56d1f48e725a0 to your computer and use it in GitHub Desktop.
>>> from flask import Flask
>>> from flask import g
>>> app=Flask('test')
>>> with app.app_context():
... g.e='test'
...
>>> with app.app_context():
... print(g.e)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/usr/local/lib/python3.6/site-packages/werkzeug/local.py", line 347, in __getattr__
return getattr(self._get_current_object(), name)
AttributeError: '_AppCtxGlobals' object has no attribute 'e'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment