Read slave, read-write master setup

I have a Flask, SQLAlchemy webapp which uses a single mysql server. I want to expand the database setup to have a read-only slave server such that I can spread the reads between both master and...

flask-login: can't understand how it works

I'm trying to understand how Flask-Login works. I see in their documentation that they use a pre-populated list of users. I want to play with a database-stored users list. However, I don't...

Connect to AWS RDS MySQL database instance with Flask-SQLAlchemy

For my Flask app, I want to use the Flask-SQLAlchemy extension to connect to a database instance I created on AWS RDS. When I try to connect, the application times out and I get the following...

Configuring Flask-SQLAlchemy to use multiple databases with Flask-Restless

I have a Flask app that uses Flask-SQLAlchemy and I'm trying to configure it to use multiple databases with the Flask-Restless package. According to the docs, configuring your models to use...

python - Flask-sqlalchemy: sqlalchemy.exc.InvalidRequestError

I'm building a backend for my iOS app and I choose to use Flask framework. For the database part, I use flask-sqlalchemy to connect my mysql database. When I put all my test code in a single file,...

SQLALCHEMY_DATABASE_URI not set

I tried to work with CURD operation using Flask and SQLAlchemy.But getting Error while connecting to database. Here is the Error...

Connect to MySQL database using Flask, SQLAlchemy

I want to connect to MySQL database using Flask. Below is my code: app.config['MYSQL_HOST'] = 'localhost' app.config['MYSQL_USER'] = 'admin' app.config['MYSQL_PASSWORD'] =...

ProgrammingError: SQLite objects created in a thread can only be used in that same thread

i'm fairly new to programming. I've tried MySQL before, but now it's my first time using SQLite in a python flask website. So maybe I'm using MySQL syntax instead of SQLite, but I can't seem...

Heroku "Application error" when deploying Flask app

I'm trying to deploy a starter Flask app to Heroku. The build and deployment are successfull, without any error. The app runs without any issues on localhost. However, when I try to view my app on...

Problems with flask and bad request

I was programming myself a pretty nice api to get some json data from my gameserver to my webspace using json, but everytime i am sending a request using angular i am getting this: 127.0.0.1 - -...

Apache Airflow: After pointing airflow.cfg to postgres, it still tries to run on MySQL

I'm using Apache-airflow2. My dags were running on LocalExecutor up until now smoothly. Now i want to scale it up and use CeleryExecutor (I'm still doing it on my Local Mac) I've configured it to...

Flask Insert data into Database using MySQL

I am trying to insert data into MYSQL database when I try my program I get an error "Not enough arguments for format the string" at the following line. ProgrammingError: 1064 (42000): You have an...

uwsgi-nginx-flask: unable to load app 0 (mountpoint='') (callable not found or import error)

Consider the following file structure: root |- app | |- api { ... } | |- logic { ... } | |- models { ... } | |- schema { ... } | |- __init__.py | |- config.py | |- sql_alchemy.py | |-...

docker-compose, migrate from links. (Flask app + mysql)

I have followed the flask mega tutorial currently done the Docker part. I tried to make a docker-compose.yml which wokrs great, but I understand that I shouldnt use "links"...

flask_sqlalchemy `pool_pre_ping` only working sometimes

For testing, I amend the MYSQL (RDS) parameters as follows; wait_timeout = 40 (default was 28800) max_allowed_packet = 1GB (max - just to be sure issue not caused by small...

Can't open lib 'ODBC Driver 17 for SQL Server' : file not found

I am fairly new to Python and Azure web apps. Any help is appreciated. My setup: Program: Visual Studio code Language: Python-Flask Cloud provider: Microsoft Azure Database: Azure SQL...

ValueError: set_wakeup_fd only works in main thread on Windows on Python 3.8 with Django 3.0.2 or Flask 2.0.0

When I run my Django Web application with Apache2.4.41 + Python 3.8.1 + Django 3.0.2 + MySQL 8.0.19 on Windows 10 Professional version it throws Value Error at /. set_wakeup_fd only works in main...

pymysql.err.OperationalError: (2006, "MySQL server has gone away (TimeoutError(110, 'Connection timed out'))")

My question is about reconnecting to MySQL server if any error encounters. I am connecting to the MySQL server in Flask: connection = pymysql.connect(host='host', ...

Implementing a Modal Form with Flask

I'm a junior developer and I have been having a hard time trying to implement a modal form in Flask. Both the Sign Up Modal and the Login Modal are on the same HTML page. It keeps saying form...

How to diagnose extremely slow AWS RDS MySQL Performance?

My DB has around 15 tables, each with 40 columns, with 10.000 rows each. Most of it with VARCHAR, some indexes and foreign keys. Sometime I need to reconstruct my database (design flaw, working on...

Web application in Flask not stable on App Engine (work fine in local)

This is my first web application "ChordMaster". It basically run a simple score editor and, at the end, you can print a pdf file. It works perfectly well in local using Flask, Flask Session,...

"cannot allocate memory in static TLS block" in a Python Flask application

I've searched online but haven't found anything that fixed my issue. I'm writing a web app in Flask using Python, but after transferring my data to a new computer and recreating the virtual...

[Flask - ElasticBeansatalk]Error: chown /var/app/staging/himasui_app/himasui_venv/bin/python: no such file or directory

I develop a flask-web-app. When I deploy the application to ElasticBeanstalk, The EB raises an Error. I don't know the solution for the error. An error occurred during execution of command...

Superset iframe login redirect

I'm trying to understand how one should be able to insert Superset's dashboards and charts inside another application. At the moment I am at this step: I have inserted the iframe of a chart inside...

NameError: name '_mysql' is not defined -- On airflow start in MacOSX

There are numbers of articles on the titled question but none of them worked for me. The detailed error is as follows: Traceback (most recent call last): File...

Flask TypeError: 'method' object is not subscriptable

I am building a dictionary app with Flask where users can add new words, the code below is the app.py file, I am having issues with the POST request, the error I am receiving on my terminal is...

AttributeError: module 'sqlalchemy' has no attribute 'NullType'

I am trying to configure flask SQLAlchemy with MySQLWorkBench, The following command works good. flask db migrate -m'Config' But when i try to execute flask db upgrade I am getting following...

Can't access my simple flask app running in docker

The app runs, but when I try to go to the link @ http://172.17.0.2:5000/ it times out. relevant code: app = Flask(__name__) @app.route('/') def index(): return "hullo" I have also tried it...

This connection is using {tls_version} which is now, unable to deploy Flask application on Linux

I am posting my first question here, so please let me know if I can improve my skills regarding asking a question here. I am deploying a python application on a linux-server which will receive a...

SQLAlchemy with multiple binds - Dynamically choose bind to query

I have 4 different databases, one for each one of my customers (medical clinics), which all of them have the exact same structure. In my application, I have models such as Patient, Doctor,...