I'm trying to get the data from a POST but I can't use the 'request' it says "NameError: name 'request' is not defined". I tried using 'import request' it says that 'No module named 'request''. This code is from my views.py that working well. Is it possible to use this also in a python file? or there is another way? I also add request to the def update_extend_traces_traceselect(request).
in my graph.py
def update_extend_traces_traceselect(request):
if request.method == 'POST':
post_data = json.loads(request.body.decode("utf-8"))
value = post_data.get('data')
print(value)