I'm using PyCharm if it matters. Whenever I use:
from flask import request
it works, no error.
But whenever I try to use the class like,
request.data
request.args
I get
raise RuntimeError('working outside of request context')
RuntimeError: working outside of request context
From the command line outside of PyCharm I get,
>>> import flask.request
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named request
>>>
I have seen this and many others,
How to get data received in Flask request
http://flask.pocoo.org/docs/0.10/api/#flask.request
None of the methods or properties are there when I try and import.
I am using a virtual environment, on Windows 7. Everything else in Flask works well.