Category "flask"

Python Flask framework. AssertionError: A setup function was called after the first request was handled

I've been following the flask tutorial to add a database, in their example they're using mysqlite while I'm using MySQL but I figured that shouldn't make a huge

Excel file corrupted after using zipfile write method in Python

I'm developing a Flask application where I want the user to download a set of files from the server. To achieve this objective, I use the zipfile module in orde

ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security'

Any ideas on why I get this error? My project was working fine. I copied it to an external drive and onto my laptop to work on the road; it worked fine. I copie

Flask_SQLAlchemy is claiming my value is not boolean?

I ran into the following error: File "/home/sandbox/.local/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 1973, in _strict_as_bool raise Ty

Angular App Not Working When Moving to Python Flask

Not sure what information to give so will do as much as I can. Currently have an Angular app sitting on IIS and using Classic ASP. All works fine. There is a dr

CSS Style Disappears on Form Button Click

I have a side panel menu that is styled how I want, along with a top nav bar. When I press the add button the form gets submitted but the style disappears on th

IIS: Angular request causes 401 unauthorized error when calling Python Flask on another port on same server

I have a legacy Angular application and there's a snippet of code below that makes a call to a ASP page on the same server and port getTableData.getUser = funct

Implementing threading with flask with application context

I am trying to implement multiprocessing or threading in my flask __init__.py to implement a sub-process that will handle some back-end work for me. However, I

Flask + React App Fails When Deployed to Heroku

I am trying to deploy a simple flask + react project to heroku. I am using gunicorn. The application works when deployed locally but fails on Heroku. The issue

Unable to find source of: ERROR [root] Error: Can't locate revision identified by '..'

I am trying to run migrations from command line and keep getting error: ERROR [root] Error: Can't locate revision identified by 'faf3ebfbe667' As suggested in

loop.nextitem doesn't work with current value from data

I need to compare postback.campaign_id with the value of the next item. If it's similar, then, I don't print nothing, if not, then, print my row. But, this code

Flask and flask-restplus dependency conflicts using Werkzeug

I am writing an API using Flask, flask-restplus, Werkzeug, and a few other irrelevant libraries. Here is the issue: flask-restplus is not compatible with the ne

Flask FileStorage file becomes empty after creating ZipFile object

I'm trying to save a .zip file received from an endpoint, but first check the contents of the .zip. If I do: import zipfile from Flask import request file = re

How to validate ObjectId query param in FastAPI

I have an endpoint that recibe and id field used to get data from MongoDB's _id: from fastapi import APIRouter from bson import ObjectId router = APIRouter()

Can I generate an Open API 3 Python Flask server?

From http://editor.swagger.io/ with swagger 2.0 I am able to select: Generate Server-->python-flask and generate a python server that I can deploy and use.

Mysql error 1045 (Access denied for user) while using flask_mysqldb

Operating System: MacOS MySQL version: 8.0.16 Code to connect MySQL: app.config['MYSQL_HOST']='localhost' app.config['MYSQL_USERNAME']='root' app.config['MYS

POST request can't pass body data from python

i am trying to post a request with body to flask REST-api but it doesn't work (Error Response 500), but when i am trying to post it from POSTMAN it works. bod

How to show netlify the file it has to run?

I have a web project written in python and Flask. I want to publish it with Netlify and for that to work it has to run the main.py file. I know that in Heroku y

APScheduler RuntimeError: No application found

I have a problem. I have IP addresses and with APScheduler I try to ping them every 10 seconds and update my database. For APScheduler I understand that I need

Flask Client-Server Connection Timeout after given time

I have a flask app. I want the client-server connection to terminate if the server does not respond within a stipulated time (say 20 seconds). I read here that