Category "flask"

TypeError: __init__() got an unexpected keyword argument 'as_tuple'

While I am testing my API I recently started to get the error below. if request is None: > builder = EnvironBuilder(*args, **kwargs) E

flask jwt extended with status code 401 in React frontend

I am using Flask-JWT-Extended, and Flask CORS with React to make a web app. According to the documents of Flask-JWT-Extended which provide the "Protected" rout

How can I refresh the data in the background of a running flask app?

I have a simple flask app that queries a database to write a csv then pyplot to create a chart out of that. I would like to refresh the data in the background e

HTML shows Flask-SQLAlchemy syntax?

When trying to display replies of users on my page it displays them with SQL syntax, like so: ('reply',) I've tried str() when returning from my route. html: &l

HTML not being displayed properly in Flask, Python

I am trying to make a website using Flask. I have designed the HTML using TeleportHQ, a drag and drop HTML designer that gives you the HTML and CSS files. I hav

flask-restful unable to add headers into response

I have a flask-restful Resource like so class UserLogin(Resource): @classmethod def post(cls): return {"msg": "test"}, 200, {"Foo": "bar"} It s

Flask CSS Error after pressing submit button

I have a flask web that makes prediction and returns it. The index page is rendered, the model receives data and makes a prediction and shows it correctly. But

ForeignKey serialized as empty dict and not getting populated with data

I've two models Profile & Product representing One-Many relationship. One profile can have many products. I'm serializing all the fields. The column which h

Python flask - Log to 2 different destinations with different log error levels

I am having a python flask app. We have used local logger with file handler and stream handler for logging messages. Handler levels INFO fh.setLevel(logging

Python flask - Log to 2 different destinations with different log error levels

I am having a python flask app. We have used local logger with file handler and stream handler for logging messages. Handler levels INFO fh.setLevel(logging

REACT Frontend not talking to backend despite Flask-CORS

I'm writing an application REACT frontend and Flask backend (with Flask-cord installed). When I make a call from the frontend I get an error Access to fetch at

Unable to get the value from the drop down from html to python program in flask

I fetch the data from Mysql and populate the values to my html form in a drop down menu.Once the user selects the option, the value which gets sent back is only

Flask Babel RuntimeError: Working outside of request context

I tried to set up multiple Dash Apps inside a Flask App and use Flask Babel. from flask import Flask, request from flask_babel import Babel, gettext from werkze

Query difference between db.session.query and Model.query in flask-SQLAlchemy

The database is near 5 millions rows. I declare a model like below: class Amodel(db.Model): id = db.Column(db.Integer, primary_key=True) date = db.Col

KeyError while passing token in session

Below is the decorator function for checking the token in the session def token_required(f): @wraps(f) def decorated(*args, **kwargs): if not se

How to prevent Flask-WTF forms from closing modal when submitting invalid input?

I am trying to build a website where you can upload a video (this already works). But when submitting a wrong file format, the Flask-WTF form closes the modal.

App Engine and flask fails to get post message from webhook

I'm doing a webhook request from Paypal webhook simulator to an App Engine service, developped in flask. The webservice has a route to get webhooks using this s

How do I persist auth between react and a flask server

I created a flask server and added the following endpoints to this server: @auth_routes.route('/login', methods=['POST']) def log_in(): log_in_data = reques

Gunicorn worker terminated with signal 9

I am running a Flask application and hosting it on Kubernetes from a Docker container. Gunicorn is managing workers that reply to API requests. The following wa

flask-apispec not populating kwargs with values from GET query (implementation of example code from documentation)

I am using flask-apispec with webargs to define the types of a simple API. I have produced a minimal example, below, that reproduces the issue, which is that th