Questions tagged [flask]

Flask is a web application framework for Python.

Flask is a web application framework for Python 2.7 and 3.4+. It has exceptional documentation, a large number of extensions and a friendly community. It is open source and BSD licensed.

36 questions
13
votes
1 answer

Why is flask CLI recommended over Flask.run?

In Flask 0.11 a flask CLI was introduced. Both the docs and the changelog state this is recommended. Development Server docs: Starting with Flask 0.11 there are multiple built-in ways to run a development server. The best one is the flask command…
Remco Haszing
  • 1,399
  • 2
  • 11
  • 18
13
votes
4 answers

Global request context - anti-pattern?

I was talking today to a colleague of mine about Python web frameworks and our impressions about them. I told him I think Flask having a global request smells badly and is an anti-pattern. The docs say about request context: In contrast, during…
warvariuc
  • 352
  • 3
  • 12
9
votes
1 answer

Do I actually need a message broker or are websockets enough?

The website I am building has a real-time messaging component. The backend is built with Flask and I have integrated Flask-SocketIO to handle Websocket connections when users are on the messaging page. My current infrastructure is pretty simple.…
turnip
  • 1,657
  • 2
  • 15
  • 21
7
votes
1 answer

How to divide work among development team members in a website project using MVC pattern

I am working on a webapp project using flask framework and sqlalchemy orm in python. Its the first time I am working on a project like this and I am having trouble in how to divide work properly among my teammates. We are 5 guys, one is handling…
codecool
  • 545
  • 6
  • 16
5
votes
2 answers

Clearing up misconceptions about a Flask backend and client-side rendering

I am building a website and along the way I have come across a lot of things I didn't know about and was hoping to get some help in understanding some of them. I started building a website using Flask and the Jinja templating language. This was very…
turnip
  • 1,657
  • 2
  • 15
  • 21
5
votes
1 answer

How to think about a schedule that pulls from a database as objects

I am working on a personal project using Python. I have been using version control to the best of my abilities and if you would like to check it out and run the app https://github.com/CodeAmend/old-bull-tools/tree/develop If you prefer Floobits,…
5
votes
1 answer

How do I structure a larger Flask application?

I have a relatively simple web application that is written in Python using the Flask microframework. I've really enjoyed Flask's ease of use, however, as the app has grown larger it has started to become unwieldy having all of my actions (and…
detour
  • 53
  • 6
4
votes
1 answer

Communication in a microservices architecture with flask and REST

Components involved: Mobile Client Microservices API Gateway Each microservice is a Flask application exposing a RESTful API. When a request is made by the mobile client, it is sent to the API Gateway. One of the most important tasks of the…
Shahlin Ibrahim
  • 151
  • 1
  • 6
4
votes
2 answers

Two processes in a single docker container or two services connecting to the same db?

I recently started moving a monolithic application to microservices architecture using docker containers. The general idea of the app is: scraping data -> format the data -> save the data to MySQL -> serve data via REST API. I want to split each…
rogamba
  • 151
  • 6
4
votes
1 answer

How safe is it to rely on thirdparty Python libs in a production product?

I'm new to Python and come from the write-everything-yourself world of PHP (at least this is how I always approached it). I'm using Flask, WTForms, Jinja2, and I've just discovered Flask-Login which I want to use. My question is about the…
skyler
  • 303
  • 1
  • 2
  • 7
2
votes
1 answer

Manager node makes HTTP request to self?

I am working on a distributed application that uses the Manager Worker pattern. The application's manager node submits work to worker nodes through a WorkerNode object (allowing WorkerNode to be treated as the server itself). The manager node can…
2
votes
1 answer

An approach to send the contents of a file on the server to the client in real-time

I have a relatively simple front in good ol' JQuery, that makes a POST Request to a Flask Python web server, that runs a Python script using the subprocess module. Here's the whole route for illustration: @app.route("/adyen_request_download",…
2
votes
1 answer

Security Pattern to store SSH Keys

I am writing a simple flask application to submit scientific tasks to remote HPC resources. My application in background talks to remote machines via SSH (because it is widely available on various HPC resources). To be able to maintain this…
mehdix
  • 221
  • 2
  • 7
1
vote
0 answers

Authorization using Azure AD B2C access tokens in Python / Flask

TLDR: I am trying to validate a Azure AD B2C access token in my Flask web API use scopes from that access token to authorize calling protected resources use timely and secure solutions such as PKCE for OAuth 2.0. what already works: [ client app ]…
linus
  • 121
  • 5
1
vote
0 answers

What's the best way to build a Flask API to control and show the status of a program tool I have built?

I've developed a backend project using Python. It collects data from different sources, process the data, and then perform actions with it (for example, store relevant info in a database). To execute it, I just do python main.py and it starts the…
p0kero
  • 11
  • 1
1
2 3