1

I have no idea what this error means:

selected = request.form.get('industry')

AttributeError: 'function' object has no attribute 'form'

Can anyone help?

1
  • in your routes.py: add form = ClassName(). Commented Oct 23, 2019 at 12:09

2 Answers 2

1

You have defined or imported a function called "request". For example by importing all attributes from a module that contains a function named "request": "from module1 import *". This shadows the request from Flask.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you bro I jt found out where did it gone wrong
1

You've imported the wrong request.

I suppose that you might have imported an request previously defined as a function from other packages and shadows flask.request. That's wrong.

What you should do is to import request from flask through the following command:

from flask import request

1 Comment

Yup, I imported request instead thank you for your support

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.