Category "flask"

How to fix error in db.create_all() in docker?

Trying to launch postgres and flask in docker. Postgres is working ok as i see. But flask is cancelling to work properly The head of log is here: Traceback (mo

How do I import flask while using pipenv, I am running into a 'module not found' error

I have installed flask using pipenv but when trying to import, I'm running into an error yet the import is listed in the Pipfile. What might be the issue?

Using Nginx with gunicorn without .sock on linux?

I have a python web app that uses Flask and gunicorn, and everything works great. I plan on hosting this on a public website and want to use nginx, but did not

flask sqlalchemy insert without session

HI is there is any way that I can insert a row to db without using session. A simple Example: try: db.session.add(user1) #in here I want to insert a row t

Multiple flask calls in single pytest having different databases

So I'm trying to test an endpoint in flask that I need to call multiple times in one test. The issue I am having is that on the second request the objects I pla

WTForms how to use description paramter

I have some simple boolean field and I want to add a short description. I specified a description parameter but it seems like no effecr. How it suppose to work

Cannot import flask_wtf into Python 3.9 venv

No matter what I do, I cannot import flask_wtf, or any variation of it - flask-wtf, flask_WTF, flask-WTF, etc. My linter doesn't recognize it (pylance in VSCod

How to extract jwt token payload when token is expired in python jwt

I am unable to extract JWT token payload after the jwt token expires in python jwt package. I am using flask api for backend development and the implementation

Flask redirecting leads to time-out error

I have this simple redirect from '/' to '/home', handled by flask with app.py @app.route('/') #Redirects to home page def redirect_home(): return redirect("

Flask-wtf SelectMultipleField: how to configure default choices

In my app I use a among others a SelectMultipleField ("stektypes") for creating “stekken”, using the following form: class createStekForm(FlaskForm)

How to make a PUT request with a full URL/link as a path parameter using Flask?

I need to add a link to a photo in my database using REST API. I have tried to add it as a string, but there is some error. My PUT call: http://127.0.0.1:3000/a

Enhanche basic datatables with buttons and clickEvent

In my Flask application I use Bootstrap 5 and datatables. The basic datatable is ok. I want to add buttons and clickEvent and that's where it goes wrong. Here's

best practices in structuring jinja templates (flask)

I wrote a site in bootstrap and thinking about refactoring it in jinja. I am not much familiar with nesting blocks, and the site is relatively simple. My goal i

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