Skip to content

Tag: flask

Contained submit button validating other forms

I have two forms on my page, each with its own fields and submit button, but whenever I use any of them, they always check the overall page fields instead of just the form they’re contained in… The simulator.html has two forms, the first one is this: And the second one is this: The views.py file h…

Can i have two different sets of app configurations?

I have made a flask server REST API that does an upload to a specific folder. The upload must comply to a specific file extension, and must be in a specific folder. So i made these two app.configs: However, i want to make a new route, for a new upload of a specific file extension to another folder. So can

More elegant way to call arbitrary Python functions from Flask

Setting up a Flask REST API is easy. I use the following approach: In this example I import functions sitting inside utility.py: This allows me to pass any function name as an argument and get the result back. So if I ran the following in my browser: I would see: The way I process the request is quite bloated…

Working outside of application context Flask JWT decorator issue

I am fairly new to Flask applications. While my application works for all the endpoints as expected when I tried to add jwt authorization I encountered this issue. I have tried this solution app.app_context().push() based on some other questions that have been posted. Any help would be greatly appreciated. I …

Blueprints in Flask vs Apps in Django [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I am new to Flask and noticed something called Blueprint in Flask. I …