Skip to main content

Questions tagged [flask]

Flask is a web application framework for Python.

Filter by
Sorted by
Tagged with
0 votes
3 answers
196 views

Architecture to avoid circular imports in Python, specifically a flask server

I have a flask server which uses a controller-service-resource model. For simplification it is like this: Controller(parses requests, dispatches to A or B): ServiceA ServiceB However there are ...
VectorVictor's user avatar
1 vote
2 answers
100 views

Dynamic web application hitting database on front page load to fetch profile image

Folks, I am in middle of writing a web application (Python/Flask) where home page has user profile image in the navbar which is coming from a database (blob), I am wondering if this is a good practice....
afsar's user avatar
  • 19
0 votes
0 answers
43 views

Best design pattern for integrating Google OAuth with existing JWT token-based authentication system

We currently have a backend authentication mechanism in place that utilizes JWT tokens. Users sign in or sign up using email and password, and upon successful authentication, the backend issues JWT ...
Samiksha Garg's user avatar
2 votes
1 answer
325 views

What really is a "web server" in relation to popular frameworks like Flask, Node.js, Apache?

In Flask you can run a "webserver". Well really it's a "WSGI Server". Well really you shouldn't be using core server features like serving files through HTTP at all, you should be ...
Leftover Salad's user avatar
-1 votes
1 answer
103 views

Is it practical to cache multiple instances of variable API data (updates hourly for each instance) for N users?

I'm using flask with SQLAlchemy on a postgresql database for a mobile app I'm building. My application allows a single user to save lets say up to 5 different locations which are saved in the database....
joepaji's user avatar
1 vote
0 answers
1k views

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 ...
linus's user avatar
  • 121
-1 votes
2 answers
262 views

What is the best practice of conditions style in Python?

We have a function that processes the user request if it is not None, how best to style it? I did not find a better choice in PEP8 Style 1 def user_handler(user): if db.getUser(user) is not None: ...
RoyalGoose's user avatar
0 votes
0 answers
407 views

HTTPS headless browser to HTTP localhost Flask

I have two Docker containers: Headless browser grabbing images by running JavaScript Flask server analysing these images (and sending results to another server) I'm using a bridge network to ...
Sijmen's user avatar
  • 9
1 vote
0 answers
82 views

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 ...
p0kero's user avatar
  • 11
2 votes
1 answer
96 views

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 ...
Stephen Collins's user avatar
-2 votes
2 answers
1k views

Should I use Flask w/ Javascript OR a Javascript UI that calls a Flask / Connexion API?

I recently wrote a data management tool in Python & SQLAlchemy. Now, I need to put a web UI on it. While I want to start small, there is some need for interactivity, like drag and drop in tables, ...
Ben's user avatar
  • 115
-3 votes
1 answer
82 views

Sharing data among websites

I manage one middle sized website that uses Flask and PostgresSQL on the backend and some JS with Angular and Jinja2 templates on the fronted. Now we're going to create a second website that will be ...
AlejandroVK's user avatar
-4 votes
1 answer
101 views

Keeping JSON in database

I'm trying to create web app(flask or django-rest) that would scrape some data and save it to JSON so that it can be viewed in the frontend (VueJS). I'm wondering if it is better to save the scraped ...
Alex T's user avatar
  • 161
1 vote
1 answer
65 views

System design : Implementing a common service process with a http server

I have a huge DB,and CalculateTasksFromDB() takes a long time (and lots of memory). Once that method is done,there is a huge list of tasks. There are worker processes in the system (at any point in ...
yoni keren's user avatar
1 vote
0 answers
995 views

How to store articles (with text and images) in SQLAlchemy database

I'm working on a blog-like application with Flask and SQLAlchemy and I'm unsure how to store the blog posts (articles) in the database. These are going to contain text and images (placed between ...
Paulo Schreiner's user avatar
2 votes
1 answer
683 views

Exchange data between python and angular with flask

I am trying to determine which is the best arquitecture to my application, I am planning to use python, mysql, angular and flask as an intermediate between python and angular. I have all the shots of ...
agm's user avatar
  • 147
1 vote
1 answer
1k views

Flask restful file upload asynchronously?

I am working on converting an existing python based monolith solution to a microservice. The current flow is pretty straight forward: Accept XLSX as input -> Run some complex algorithms based on ...
Pro's user avatar
  • 163
9 votes
1 answer
11k views

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....
turnip's user avatar
  • 1,677
0 votes
2 answers
223 views

Data Collection Web Application Architecture

I am building a Data Collection Web Application with Flask and MySQL Database. It is basically a creating a Bill Of Materials for the organization for a new product. Bill of Material in a form looks ...
Kartikeya Sharma's user avatar
0 votes
0 answers
100 views

Flask/SQLAlchemy Object Classes across app layers

I’m looking for advice where the business logic and data layers in a Flask/SQLAlchemy-based app all use essentially the same object class. As an example, my app includes a task scheduler. Tasks ...
nakb's user avatar
  • 119
1 vote
2 answers
5k views

REST API Input Validation Strategy

I am implementing a REST API and need to validate the JSON API inputs for the CREATE and UPDATE endpoints. The goal is to send a 400 error prior to doing any processing if the inputs are not valid. ...
nbarraille's user avatar
1 vote
2 answers
596 views

Architecture for RESTful API and a web admin

I am trying to build a RESTful API (using Flask) that will be later consumed by a mobile application. I also have a requirement to build a Web Admin. The Web Admin will have functionality that will ...
ellaRT's user avatar
  • 137
0 votes
1 answer
58 views

Abstracting a set of services behind a common interface

Yay or nay? I have several related but separate services that are to be run in different processes. They execute a particular task unique to the service. Their call signature is similar, but the name ...
Felix's user avatar
  • 377
5 votes
2 answers
2k views

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 ...
turnip's user avatar
  • 1,677
4 votes
1 answer
3k views

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 ...
Shahlin Ibrahim's user avatar
2 votes
1 answer
61 views

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 ...
Ericson Willians's user avatar
0 votes
1 answer
127 views

Security and performance considerations when creating chat system on a Flask backend

I am building a website with the Flask framework. One functionality of the site will be that users can send messages to each other. I created a prototype of this using Flask WTF forms. The basic ...
turnip's user avatar
  • 1,677
0 votes
2 answers
34 views

Organizing specific human messaging in the web applicaiton code

Python (Flask) web application has a big portion of email/SMS messages generated by templates, translated by Flask-Babel. To my eye, having literal constants for the message in views, among other ...
Roman Susi's user avatar
  • 1,773
4 votes
2 answers
1k views

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 -...
rogamba's user avatar
  • 151
13 votes
1 answer
11k views

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 ...
Remco Haszing's user avatar
1 vote
0 answers
182 views

Choosing Between Ruby and Python for a FS Microservice Backend in Node App [closed]

I have been working on a application that up until now has been pure Node. However I am concerned about performance and overhead since the application performs a lot of file system operations (Copy ...
Taylor Ackley's user avatar
5 votes
1 answer
880 views

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-...
Michael Bruce's user avatar
1 vote
1 answer
701 views

Hard time understanding structure of web apps w JS frameworks? [closed]

I'm having a difficult time understanding how web applications work. Please help me understand without giving me google definitions. Baby steps/words would be appreciated =) From what I understand so ...
Angular's user avatar
  • 113
0 votes
1 answer
1k views

How to stop someone from calling URL on server

I am very new to web development and am trying to create a website using client/server model. From what I understand, the front-end (client-side) calls URLs specified on the server to get information. ...
kev's user avatar
  • 11
2 votes
1 answer
155 views

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 ...
mehdix's user avatar
  • 251
13 votes
4 answers
7k views

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 ...
warvariuc's user avatar
  • 352
0 votes
1 answer
858 views

Why does flask use Jinja2 and not xpath?

I'm just starting out with python and since I'm coming from a PHP background (thus have to adjust my mind to wrap around new concepts) one major question still stands without answer - why does Flask ...
Morgan Wilde's user avatar
4 votes
1 answer
982 views

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 ...
skyler's user avatar
  • 303
7 votes
1 answer
6k views

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 ...
codecool's user avatar
  • 555
5 votes
1 answer
2k views

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 ...
detour's user avatar
  • 53