[Tutor] if request.method == 'GET': NameError: global name 'request' is not defined

sudipto manna sudiptod19 at gmail.com
Mon Jan 18 10:59:33 EST 2016


Thanks All.
The import request was missing and the issue was resolved upon calling that
module and initializing it.

Thanks for the guidance.

Regards,
Sudipto Manna

On Mon, Jan 18, 2016 at 3:55 AM, Cameron Simpson <cs at zip.com.au> wrote:

> On 17Jan2016 20:13, sudipto manna <sudiptod19 at gmail.com> wrote:
>
>> Here is the code snippet:
>>
>> File#FlaskTest2.py
>>
>> from flask import Flask
>>
>
> You need to import "request" from flask as well:
>
>  from flask import Flask, request
>
> For others on this list: the Flask framework presents the current web
> request as a thread local global called "request"; simplifies writing
> handlers as the request information is readily available without having to
> pass it through function calls.
>
> Cheers,
> Cameron Simpson <cs at zip.com.au>
>


More information about the Tutor mailing list