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

2016-01-18 Thread Danny Yoo
On Mon, Jan 18, 2016 at 7:59 AM, sudipto manna wrote: > Thanks All. > The import request was missing and the issue was resolved upon calling that > module and initializing it. Hi Sudipto Manna, One last thing before you go on. Do a small retrospective: now that you know why things weren't wor

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

2016-01-18 Thread sudipto manna
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 wrote: > On 17Jan2016 20:13, sudipto manna wrote: > >> Here is the code snippet:

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

2016-01-18 Thread Cameron Simpson
On 17Jan2016 20:13, sudipto manna 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

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

2016-01-18 Thread Alan Gauld
On 18/01/16 02:13, sudipto manna wrote: > Here is the code snippet: > > File#FlaskTest2.py > > from flask import Flask > > app = Flask(__name__) > > #Make an app.route() decorator here > @app.route("/puppies/", methods = ['GET' , 'POST']) > def puppiesFunction(): > if request.method == 'GET': >

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

2016-01-18 Thread Danny Yoo
On Sun, Jan 17, 2016 at 6:13 PM, sudipto manna wrote: > Here is the code snippet: > > File#FlaskTest2.py > > from flask import Flask > > app = Flask(__name__) > > #Make an app.route() decorator here > @app.route("/puppies/", methods = ['GET' , 'POST']) > def puppiesFunction(): > if request.metho

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

2016-01-18 Thread sudipto manna
Here is the code snippet: File#FlaskTest2.py from flask import Flask app = Flask(__name__) #Make an app.route() decorator here @app.route("/puppies/", methods = ['GET' , 'POST']) def puppiesFunction(): if request.method == 'GET': return getAllPuppies() elif request.method == 'POST': r

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

2016-01-17 Thread Alan Gauld
On 17/01/16 23:15, sudipto manna wrote: > Hi All, > I am running a python flask project for fetching the endpoint. > > Please find the files attached. OK, This is a text based mailing list so attachments tend not to make it through the server. If they are not too long post them here, or if they a

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

2016-01-17 Thread sudipto manna
Hi All, I am running a python flask project for fetching the endpoint. Please find the files attached. Parent file: FlaskTest2.py Endpoint Tester File: FlaskTendpointTester2.py Process: 1. Execute the file FlaskTest2.py --> python FlaskTest2.py # This will execute the file on the terminal and wil