Skip to content
Advertisement

Tag: flask

Flask SQLAlchemy reflection ignoring most of tables on Redshift

I’m creating the engine and the Metadata as follows Yields AttributeError: packages, and dir(Base.classes) returns no attributes with that name, neither with the orders name. Taking the only=[‘orders’, ‘packages’] off makes it reflect only a few random tables. Now, when using the inspector that comes with native SQLAlchemy the table actually works (link to documentation): Is this a bug, or

Python flask-sqlalchemy: Do I have to commit session after a query?

I am writing an app in python flask-sqlalchemy with MySQL DB (https://flask-sqlalchemy.palletsprojects.com/en/2.x/) and I am wondering if I have to make “db.session.commit() or db.session.rollback()” after GET call, which only query DB . For example: Answer orders = Order.query.all() is a SELECT query that could be extended to include additional filters (WHERE etc.). It doesn’t alter the database, it simply reads

KeyError: ‘HTTP_ACCESS_TOKEN’ : Flask with gevent WSGIServer

I am trying to take my Flask application to production with gevent WSGIServer I am running the app server with gevent WSGIServer. Whenever I am trying to fetch any data like Receiving the following error Answer pywsgi has something called SecureEnviron. This is intended to keep potentially sensitive information like HTTP authorization and cookies from being inadvertently printed or logged.

Serving static files in elastick beanstalk

I’m deploying a python3 flask application in aws elasitc beanstalk (Amazon Linux 2 platform). The folder structure is as follows: In the template files, importing of static resources are defiled as: i.e. JS file: In the EB configurations, I’ve defined the static resources as below But the problem is, these resources are not loading and giving 404. i.e.: https://example.com/static/js/jquery.js cannot

middleware caught exception in streamed response flask app

This is an simple application that inserts data into a mysql db. The data gets inserted correctly but i am not getting the reponse of my post request but the status is 200.request.form works but i want to send json as payload This is my below route and i believe something is wrong when i am checking if the keys

Advertisement