Category "flask"

Share session data between Flask apps in separate Docker containers that are served using a reverse proxy

I have a Docker app running on localhost. There are multiple flask apps each in its own container. One is on the root (localhost) and the others are on subdomai

Options for User Session Management with React and Flask

After days of reading through the source code of Flask and Flask-Login and trying to figure out why my user sessions aren't being visibly accessible outside the

Flask SERVER_NAME setting best pratices

Since my app has background tasks, I use the Flask context. For the context to work, the Flask setting SERVER_NAME should be set. When the SERVER_NAME is set th

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

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