ImportError: cannot import name

The problem is that you have a circular import: in app.py in mod_login.py This is not permitted in Python. See Circular import dependency in Python for more info. In short, the solution are either gather everything in one big file delay one of the import using local import

Get the data received in a Flask request

The docs describe the attributes available on the request object (from flask import request) during a request. In most common cases request.data will be empty because it’s used as a fallback: request.data Contains the incoming request data as string in case it came with a mimetype Flask does not handle. request.args: the key/value pairs in the URL query string request.form: the key/value … Read more

Get the data received in a Flask request

The docs describe the attributes available on the request object (from flask import request) during a request. In most common cases request.data will be empty because it’s used as a fallback: request.data Contains the incoming request data as string in case it came with a mimetype Flask does not handle. request.args: the key/value pairs in the URL query string request.form: the key/value … Read more

Internal Redirect in Flask

You should use the Post-Redirect-Get pattern. And if you want to pass data to the target function (like that token) you can use the session object to store it So that would break down something like Edit: I haven’t used Flask-JWT before and didn’t know about the post requirement. But you can tell Flask to redirect … Read more

json.dumps vs flask.jsonify

The jsonify() function in flask returns a flask.Response() object that already has the appropriate content-type header ‘application/json’ for use with json responses. Whereas, the json.dumps() method will just return an encoded string, which would require manually adding the MIME type header. See more about the jsonify() function here for full reference. Edit: Also, I’ve noticed … Read more