Flask request object always empty (GET and POST)











up vote
2
down vote

favorite












this is the code:



from flask import Flask
from flask import request, redirect, url_for, render_template
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:root@localhost/gradelink'
db = SQLAlchemy(app)

class Location(db.Model):
__tablename__ = 'location'
id = db.Column('id', db.Integer, primary_key=True)
location_name = db.Column('location_name', db.String(250), unique=True)

def __init__(self, location_name):
self.location_name = location_name

def __repr__(self):
return '<Location %r' % self.location_name

@app.route('/')
def index():
return render_template('home.html');

@app.route('/location', methods=['GET', 'POST'])
def location():
return render_template('location.html');

@app.route('/post_location', methods=['POST'])
def post_location():
if request.method == "POST":
location_n = request.form['location_name']

return redirect(url_for('index'))

@app.route('/location_list', methods=['GET', 'POST'])
def location_list():
locationList = Location.query.all()
return render_template('location_list.html', locationList=locationList);

if __name__ == '__main__':
app.run(debug=True)


I tried with both, GET and POST but still, same result:



object has no attribute 'data'



object has no attribute 'form'



location_list works perfectly.



looks like the request is always empty



my submission form html:



<!DOCTYPE html>
<html>
<head>
<title>Location Form</title>
<meta charset="utf-8" />
</head>
<body>
<form method="post" action="/post_location">
<label>Location name:</label>
<input id="location_name" name="location_name" type="text" />
<input type="submit" />
</form>
</body>
</html>


What am I doing wrong?



EDIT 1:



I tried this:



@app.route('/post_location', methods=['POST'])
def post_location():
if request.method == "POST":
location_n = request.form['location_name']

return redirect(url_for('index'))


now the error message is:



'function' object has no attribute 'method'



EDIT 2:



I don't have a function called request and I don't have many other functions (this is a new fresh project)



No I don't have any flask.py files in any of my project folders.



EDIT 3: Flask and Python versions



C:UsersDaniel>flask --version
Flask 1.0.2
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]


Traceback



builtins.AttributeError
AttributeError: 'function' object has no attribute 'method'

Traceback (most recent call last)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:myprojectflask__init__.py", line 89, in post_location
if request.method == "POST":
AttributeError: 'function' object has no attribute 'method'









share|improve this question




















  • 1




    Do you have a function called request defined somewhere? Do you have a file in your path that happens to be called flask.py? How are you initializing and running the Flask App? Do. You know how to run your code in debug mode? Do that and inspect what request actually is, because it sounds like it's not actually the request proxy from Flask.
    – Iguananaut
    Nov 8 at 23:20












  • Perhaps it would help to post your full code.
    – Iguananaut
    Nov 8 at 23:26










  • I added the full code to the question, how can I inspect the request? the code is in debug already
    – Daniel Boldrin
    Nov 8 at 23:31












  • I admit I can't see anything imm wrong with the code. How do you run it? How are the errors reported? Do you get a traceback? Does the Flask server start at all?
    – Iguananaut
    Nov 8 at 23:42










  • Oh, tho in your HTML do write method="post" in lowercase.
    – Iguananaut
    Nov 8 at 23:45















up vote
2
down vote

favorite












this is the code:



from flask import Flask
from flask import request, redirect, url_for, render_template
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:root@localhost/gradelink'
db = SQLAlchemy(app)

class Location(db.Model):
__tablename__ = 'location'
id = db.Column('id', db.Integer, primary_key=True)
location_name = db.Column('location_name', db.String(250), unique=True)

def __init__(self, location_name):
self.location_name = location_name

def __repr__(self):
return '<Location %r' % self.location_name

@app.route('/')
def index():
return render_template('home.html');

@app.route('/location', methods=['GET', 'POST'])
def location():
return render_template('location.html');

@app.route('/post_location', methods=['POST'])
def post_location():
if request.method == "POST":
location_n = request.form['location_name']

return redirect(url_for('index'))

@app.route('/location_list', methods=['GET', 'POST'])
def location_list():
locationList = Location.query.all()
return render_template('location_list.html', locationList=locationList);

if __name__ == '__main__':
app.run(debug=True)


I tried with both, GET and POST but still, same result:



object has no attribute 'data'



object has no attribute 'form'



location_list works perfectly.



looks like the request is always empty



my submission form html:



<!DOCTYPE html>
<html>
<head>
<title>Location Form</title>
<meta charset="utf-8" />
</head>
<body>
<form method="post" action="/post_location">
<label>Location name:</label>
<input id="location_name" name="location_name" type="text" />
<input type="submit" />
</form>
</body>
</html>


What am I doing wrong?



EDIT 1:



I tried this:



@app.route('/post_location', methods=['POST'])
def post_location():
if request.method == "POST":
location_n = request.form['location_name']

return redirect(url_for('index'))


now the error message is:



'function' object has no attribute 'method'



EDIT 2:



I don't have a function called request and I don't have many other functions (this is a new fresh project)



No I don't have any flask.py files in any of my project folders.



EDIT 3: Flask and Python versions



C:UsersDaniel>flask --version
Flask 1.0.2
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]


Traceback



builtins.AttributeError
AttributeError: 'function' object has no attribute 'method'

Traceback (most recent call last)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:myprojectflask__init__.py", line 89, in post_location
if request.method == "POST":
AttributeError: 'function' object has no attribute 'method'









share|improve this question




















  • 1




    Do you have a function called request defined somewhere? Do you have a file in your path that happens to be called flask.py? How are you initializing and running the Flask App? Do. You know how to run your code in debug mode? Do that and inspect what request actually is, because it sounds like it's not actually the request proxy from Flask.
    – Iguananaut
    Nov 8 at 23:20












  • Perhaps it would help to post your full code.
    – Iguananaut
    Nov 8 at 23:26










  • I added the full code to the question, how can I inspect the request? the code is in debug already
    – Daniel Boldrin
    Nov 8 at 23:31












  • I admit I can't see anything imm wrong with the code. How do you run it? How are the errors reported? Do you get a traceback? Does the Flask server start at all?
    – Iguananaut
    Nov 8 at 23:42










  • Oh, tho in your HTML do write method="post" in lowercase.
    – Iguananaut
    Nov 8 at 23:45













up vote
2
down vote

favorite









up vote
2
down vote

favorite











this is the code:



from flask import Flask
from flask import request, redirect, url_for, render_template
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:root@localhost/gradelink'
db = SQLAlchemy(app)

class Location(db.Model):
__tablename__ = 'location'
id = db.Column('id', db.Integer, primary_key=True)
location_name = db.Column('location_name', db.String(250), unique=True)

def __init__(self, location_name):
self.location_name = location_name

def __repr__(self):
return '<Location %r' % self.location_name

@app.route('/')
def index():
return render_template('home.html');

@app.route('/location', methods=['GET', 'POST'])
def location():
return render_template('location.html');

@app.route('/post_location', methods=['POST'])
def post_location():
if request.method == "POST":
location_n = request.form['location_name']

return redirect(url_for('index'))

@app.route('/location_list', methods=['GET', 'POST'])
def location_list():
locationList = Location.query.all()
return render_template('location_list.html', locationList=locationList);

if __name__ == '__main__':
app.run(debug=True)


I tried with both, GET and POST but still, same result:



object has no attribute 'data'



object has no attribute 'form'



location_list works perfectly.



looks like the request is always empty



my submission form html:



<!DOCTYPE html>
<html>
<head>
<title>Location Form</title>
<meta charset="utf-8" />
</head>
<body>
<form method="post" action="/post_location">
<label>Location name:</label>
<input id="location_name" name="location_name" type="text" />
<input type="submit" />
</form>
</body>
</html>


What am I doing wrong?



EDIT 1:



I tried this:



@app.route('/post_location', methods=['POST'])
def post_location():
if request.method == "POST":
location_n = request.form['location_name']

return redirect(url_for('index'))


now the error message is:



'function' object has no attribute 'method'



EDIT 2:



I don't have a function called request and I don't have many other functions (this is a new fresh project)



No I don't have any flask.py files in any of my project folders.



EDIT 3: Flask and Python versions



C:UsersDaniel>flask --version
Flask 1.0.2
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]


Traceback



builtins.AttributeError
AttributeError: 'function' object has no attribute 'method'

Traceback (most recent call last)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:myprojectflask__init__.py", line 89, in post_location
if request.method == "POST":
AttributeError: 'function' object has no attribute 'method'









share|improve this question















this is the code:



from flask import Flask
from flask import request, redirect, url_for, render_template
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:root@localhost/gradelink'
db = SQLAlchemy(app)

class Location(db.Model):
__tablename__ = 'location'
id = db.Column('id', db.Integer, primary_key=True)
location_name = db.Column('location_name', db.String(250), unique=True)

def __init__(self, location_name):
self.location_name = location_name

def __repr__(self):
return '<Location %r' % self.location_name

@app.route('/')
def index():
return render_template('home.html');

@app.route('/location', methods=['GET', 'POST'])
def location():
return render_template('location.html');

@app.route('/post_location', methods=['POST'])
def post_location():
if request.method == "POST":
location_n = request.form['location_name']

return redirect(url_for('index'))

@app.route('/location_list', methods=['GET', 'POST'])
def location_list():
locationList = Location.query.all()
return render_template('location_list.html', locationList=locationList);

if __name__ == '__main__':
app.run(debug=True)


I tried with both, GET and POST but still, same result:



object has no attribute 'data'



object has no attribute 'form'



location_list works perfectly.



looks like the request is always empty



my submission form html:



<!DOCTYPE html>
<html>
<head>
<title>Location Form</title>
<meta charset="utf-8" />
</head>
<body>
<form method="post" action="/post_location">
<label>Location name:</label>
<input id="location_name" name="location_name" type="text" />
<input type="submit" />
</form>
</body>
</html>


What am I doing wrong?



EDIT 1:



I tried this:



@app.route('/post_location', methods=['POST'])
def post_location():
if request.method == "POST":
location_n = request.form['location_name']

return redirect(url_for('index'))


now the error message is:



'function' object has no attribute 'method'



EDIT 2:



I don't have a function called request and I don't have many other functions (this is a new fresh project)



No I don't have any flask.py files in any of my project folders.



EDIT 3: Flask and Python versions



C:UsersDaniel>flask --version
Flask 1.0.2
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]


Traceback



builtins.AttributeError
AttributeError: 'function' object has no attribute 'method'

Traceback (most recent call last)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "C:UsersDanielAppDataLocalProgramsPythonPython37libsite-packagesflaskapp.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:myprojectflask__init__.py", line 89, in post_location
if request.method == "POST":
AttributeError: 'function' object has no attribute 'method'






python postgresql post flask request






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 13:27

























asked Nov 8 at 21:40









Daniel Boldrin

628




628








  • 1




    Do you have a function called request defined somewhere? Do you have a file in your path that happens to be called flask.py? How are you initializing and running the Flask App? Do. You know how to run your code in debug mode? Do that and inspect what request actually is, because it sounds like it's not actually the request proxy from Flask.
    – Iguananaut
    Nov 8 at 23:20












  • Perhaps it would help to post your full code.
    – Iguananaut
    Nov 8 at 23:26










  • I added the full code to the question, how can I inspect the request? the code is in debug already
    – Daniel Boldrin
    Nov 8 at 23:31












  • I admit I can't see anything imm wrong with the code. How do you run it? How are the errors reported? Do you get a traceback? Does the Flask server start at all?
    – Iguananaut
    Nov 8 at 23:42










  • Oh, tho in your HTML do write method="post" in lowercase.
    – Iguananaut
    Nov 8 at 23:45














  • 1




    Do you have a function called request defined somewhere? Do you have a file in your path that happens to be called flask.py? How are you initializing and running the Flask App? Do. You know how to run your code in debug mode? Do that and inspect what request actually is, because it sounds like it's not actually the request proxy from Flask.
    – Iguananaut
    Nov 8 at 23:20












  • Perhaps it would help to post your full code.
    – Iguananaut
    Nov 8 at 23:26










  • I added the full code to the question, how can I inspect the request? the code is in debug already
    – Daniel Boldrin
    Nov 8 at 23:31












  • I admit I can't see anything imm wrong with the code. How do you run it? How are the errors reported? Do you get a traceback? Does the Flask server start at all?
    – Iguananaut
    Nov 8 at 23:42










  • Oh, tho in your HTML do write method="post" in lowercase.
    – Iguananaut
    Nov 8 at 23:45








1




1




Do you have a function called request defined somewhere? Do you have a file in your path that happens to be called flask.py? How are you initializing and running the Flask App? Do. You know how to run your code in debug mode? Do that and inspect what request actually is, because it sounds like it's not actually the request proxy from Flask.
– Iguananaut
Nov 8 at 23:20






Do you have a function called request defined somewhere? Do you have a file in your path that happens to be called flask.py? How are you initializing and running the Flask App? Do. You know how to run your code in debug mode? Do that and inspect what request actually is, because it sounds like it's not actually the request proxy from Flask.
– Iguananaut
Nov 8 at 23:20














Perhaps it would help to post your full code.
– Iguananaut
Nov 8 at 23:26




Perhaps it would help to post your full code.
– Iguananaut
Nov 8 at 23:26












I added the full code to the question, how can I inspect the request? the code is in debug already
– Daniel Boldrin
Nov 8 at 23:31






I added the full code to the question, how can I inspect the request? the code is in debug already
– Daniel Boldrin
Nov 8 at 23:31














I admit I can't see anything imm wrong with the code. How do you run it? How are the errors reported? Do you get a traceback? Does the Flask server start at all?
– Iguananaut
Nov 8 at 23:42




I admit I can't see anything imm wrong with the code. How do you run it? How are the errors reported? Do you get a traceback? Does the Flask server start at all?
– Iguananaut
Nov 8 at 23:42












Oh, tho in your HTML do write method="post" in lowercase.
– Iguananaut
Nov 8 at 23:45




Oh, tho in your HTML do write method="post" in lowercase.
– Iguananaut
Nov 8 at 23:45












2 Answers
2






active

oldest

votes

















up vote
0
down vote













So I ended up closing everything, restarting my computer and python. I received a different error (some lines had spaces instead of TAB for indentation) but easily fixed and then everything worked fine.






share|improve this answer




























    up vote
    -1
    down vote













    Before your locationName, put in if request.method == POST: Then tab everything over underneath.






    share|improve this answer





















    • I tried your suggestion but it didn't work (take a look at my edit1)
      – Daniel Boldrin
      Nov 8 at 23:14











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53216554%2fflask-request-object-always-empty-get-and-post%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    So I ended up closing everything, restarting my computer and python. I received a different error (some lines had spaces instead of TAB for indentation) but easily fixed and then everything worked fine.






    share|improve this answer

























      up vote
      0
      down vote













      So I ended up closing everything, restarting my computer and python. I received a different error (some lines had spaces instead of TAB for indentation) but easily fixed and then everything worked fine.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        So I ended up closing everything, restarting my computer and python. I received a different error (some lines had spaces instead of TAB for indentation) but easily fixed and then everything worked fine.






        share|improve this answer












        So I ended up closing everything, restarting my computer and python. I received a different error (some lines had spaces instead of TAB for indentation) but easily fixed and then everything worked fine.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 9 at 21:34









        Daniel Boldrin

        628




        628
























            up vote
            -1
            down vote













            Before your locationName, put in if request.method == POST: Then tab everything over underneath.






            share|improve this answer





















            • I tried your suggestion but it didn't work (take a look at my edit1)
              – Daniel Boldrin
              Nov 8 at 23:14















            up vote
            -1
            down vote













            Before your locationName, put in if request.method == POST: Then tab everything over underneath.






            share|improve this answer





















            • I tried your suggestion but it didn't work (take a look at my edit1)
              – Daniel Boldrin
              Nov 8 at 23:14













            up vote
            -1
            down vote










            up vote
            -1
            down vote









            Before your locationName, put in if request.method == POST: Then tab everything over underneath.






            share|improve this answer












            Before your locationName, put in if request.method == POST: Then tab everything over underneath.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 8 at 22:23









            Tom Mitchell

            145




            145












            • I tried your suggestion but it didn't work (take a look at my edit1)
              – Daniel Boldrin
              Nov 8 at 23:14


















            • I tried your suggestion but it didn't work (take a look at my edit1)
              – Daniel Boldrin
              Nov 8 at 23:14
















            I tried your suggestion but it didn't work (take a look at my edit1)
            – Daniel Boldrin
            Nov 8 at 23:14




            I tried your suggestion but it didn't work (take a look at my edit1)
            – Daniel Boldrin
            Nov 8 at 23:14


















             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53216554%2fflask-request-object-always-empty-get-and-post%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Guess what letter conforming each word

            Port of Spain

            Run scheduled task as local user group (not BUILTIN)