NameError: name 'request' is not defined

后端 未结 3 575
無奈伤痛
無奈伤痛 2020-12-29 01:02

I got this Python Code, and somehow I get the Error Message:

File \"/app/identidock.py\", line 13, in mainpage
if request.method == \'POST\':
N         


        
相关标签:
3条回答
  • 2020-12-29 01:41

    You appear to have forgotten to import the flask.request request context object:

    from flask import request
    
    0 讨论(0)
  • 2020-12-29 01:50

    You are probably missing the following import statement:

    from flask import request
    

    that should be placed in the header of the file.

    0 讨论(0)
  • 2020-12-29 01:55

    Use this will Work,

    self.request

    0 讨论(0)
提交回复
热议问题