Questions tagged [flask]

Flask is a micro-framework for Python based on Werkzeug, Jinja 2 and good intentions.

Filter by
Sorted by
Tagged with
1
vote
0answers
45 views

Flask API for converting Contact Form responses to Email notifications (with reCAPTCHAv2)

Introduction I wrote a proof-of-concept Flask server that accepts responses from a contact form and converts the data submitted to an email. I have added a rudimentary honeypot field that causes the ...
1
vote
0answers
39 views

Flask Session + Jinja OR Javascript + Flask

I'm a beginner in programming and I'm figuring out what is the best approach for my mini e commerce site project. My current approach is ...
1
vote
0answers
43 views

Python app thats simulate simple Stock Exchange

I wrote this simple app for creating a Stock Exchange platform. It is written with a flask framework. My main concerns are regarding the user_page route which feels too long and not DRY enough, But on ...
0
votes
2answers
75 views

Getting a username from a database and displaying it in HTML

I'm using Flask on Python and I'm displaying the username at the top of the site (and it's working) as follows: ...
1
vote
1answer
52 views

Read and display JSON results from Google Books API

I’m working with the Google Books API and I’m not so sure about the way I’m going to get the search data and return it to the user. I will describe the path here and I would like to know if you would ...
4
votes
1answer
49 views

Python Rubiks cube solver - general code comments

I have been learning Python/Flask for the past 5 months outside of full time work and have just finished a first complete version of an app: Working site: https://rubiks-cube-solver.herokuapp.com/ ...
2
votes
1answer
49 views

Query the github api and filter the last 1000 commits which include and exclude certain words from the top 3 repositories in a given organization

This code should query the github api and filter, out of the last 1000 commits, which ones include and exclude certain words from the top 3 repositories in a given organization. For example, I could ...
0
votes
0answers
41 views

Python - Pagination class

I built a small flask app and a lot of routes do need some kind of pagination system. However, in some cases I would like to just display n-2, n-1, n, n+1, n+2 ...
2
votes
1answer
47 views

Run python File With get request flask API

Code is Working Review and Recommend What Are Best Practice What I am trying to achieve. API with Flask that runs any python file from the current directory. Run the file and get output in JSON ...
1
vote
1answer
36 views

text-messaging app using twilio

I build a small web-app using flask for my parents to text their customers about promotions. I am using Twilio API. I just finished the myapp.com/new-campaign page ...
2
votes
1answer
93 views

Python: separation of concern User Model and User DB

I am working on a small side-project since a couple of weeks, I am using Flask but trying to use as few libraries as possible and no ORMs (for learning purposes. I am currently working on the User ...
0
votes
0answers
37 views

Flask blueprints and context_processor - Best approch?

I am working on a Flask application (side-project) to send text-messages to customers using Twilio. There is two different list of customers, 1 for testing and for ...
0
votes
0answers
68 views

Fastapi with Aiohttp not providing expected results

I am new to asynchronous programming in python. Below are two scripts(which perform the same operation) one in Fastapi + aiohttp while other is basic Flask + requests library: ...
0
votes
0answers
21 views

Organization of work with MongoDB in Flask

I`m trying to make an API for Flask together with MongoDB, before that I used the SQL DB using SQLAlchemy and there I used models for organizing the database. Now I'm a bit confused how to organize ...
1
vote
1answer
40 views

Populate database of web articles

What I have here is a relatively simple endpoint for a small site I'm making. Idea is to take: title content tags and create an entry in the database. It works properly. I threw this together as ...
2
votes
1answer
51 views

Python (Flask) - User registration system

I am working on a simple CRUD app as a personal project using Flask. I am currently working on the user service and I just finished the registration process. I am also trying to use as less as ...
3
votes
1answer
147 views

Python OOP - Web App (Flask) - User registration class?

I am working on a simple CRUD app as a personal project using Flask. I am currently working on the user blueprint and trying to use as less as libraries as I could and no ORM (for learning purposes). ...
0
votes
0answers
23 views

Optimized method of transfering numpy image arrays over localhost to web-tech UI for desktop UI

I have been doing testing to find the most efficient way to display numpy array images to a HTML, CSS, JS UI (specifically, with CEF Python). I mainly used the method explained here to do the numpy ...
0
votes
2answers
42 views

on using the strategy pattern to switch between database layers

I'd like to build an app in Flask that can switch between talking to a PostGresql and a Mongo DB. As I understand it, the Strategy Pattern is about being able to switch algorithms that are referred ...
3
votes
1answer
64 views

Flask Database Design with ORM

I am designing a Stock Currency application and for that, I created a database. I searched for my question here first but the answerer told me to ask the same question here. ...
12
votes
3answers
98 views

Suggestions on cleaning up Flask app

I've written a little bit of code to pull data out of my FitBit and store it in a GCP database for further analysis. The project is available here, but what I'd like to ask about specifically is the ...
3
votes
1answer
1k views

python flask spawn jobs with multiprocessing

I have a python flask app that waits for requests from user app and than spawns a process with job based on the request it receives. It keeps the status and queue of the jobs in memory. The requests ...
3
votes
1answer
37 views

Flask app to return close prices & average

I've been working on a little challenge in order to learn more.. I've written the following code, which works. I'm just concerned that there are several areas where my lack of in depth Python ...
4
votes
1answer
554 views

Python Flask, best way for users to update profile details

I have a very standard Flask website being built, more or less straight out of the documentation though am now at a point where I'm going a bit off the book and am probably being highly inefficient ...
6
votes
1answer
333 views

Air Quality/Environment Monitoring Web App using Plotly Dash

Overview & Motivation This project manages and displays sensor data (temperature, humidity, Air Quality Index). The sensor data is displayed by the sensor manufacturer, PurpleAir, but their tool ...
1
vote
0answers
28 views

Improving response time of flask endpoint

The flask endpoint is supposed to take a table name as a parameter, and then return the entire contents of the table as JSON. The table has 200,000 rows and I was wondering if there is any way to ...
2
votes
0answers
180 views

Simple Flask REST API to a MongoDB

I'm writing a simple REST API to my MongoDB using PyMongo (Python 3.7). Each collection I have in the DB has a route (e.g http://the.api.url/collection_name ), and every document under that collection ...
2
votes
3answers
57 views

Track the existence of process

I have an api endpoint that, when called, initiates the generation of a report. This is time consuming process and response could come pretty late. So, we came up with caching architecture and once ...
4
votes
1answer
82 views

Weather Forecast Web Application

I've made a Python Flask app and I have some questions about the structure of the main module (equivalent of index.py). Here is what it looks like: ...
2
votes
0answers
74 views

Return aggregated values

It's the first time a write a non-trivial mongodb query, and I came up with one that does work, but is 123 lines long! Surely there must be a way to write it in a more concise way. The purpose of the ...
1
vote
1answer
79 views

How to make the filtering queries more efficient using flask sqlalchemy?

I have a following table in a flask app ...
2
votes
0answers
46 views

Basic flask template with sessions

This Flask app, which makes use of SQLAlchemy, a MySQL server which is only reachable via SSH and Flask-Login, is the base on which I want to write an application which has login protected pages. ...
1
vote
0answers
388 views

Celery tasks and Flask application factory

I am implementing a few Celery background tasks (e.g sending an email, subscribing someone to an Audience via Mailchimp API, etc.) and my project relies on a Flask application factory. Now, I am ...
1
vote
0answers
49 views

querying users from table if user.id is found in another table

I am using flask with sqlAlchemy to connect with a postgresql database with two tables Users table (id, name) ...
4
votes
1answer
404 views

9X9 Tic Tac Toe variant with frontend in react and backend in python flask_socketio

I (a junior back-end Java dev) decided I wanted to learn some front-end development skills; in particular, I wanted experience with React and websockets. I decided to write an app that would allow for ...
4
votes
0answers
78 views

Potential Security Threats With Custom Login

I'm looking to find what security flaws this code might have. I believe it's immune to time attacks, passwords are stored encrypted, and I'm using sessions to store local data. Let's assume the ...
2
votes
0answers
40 views

Six Nations Prediction league Web App

I built a simple web app to manage my friends and I's six nation prediction league. This is my first go at web development so although it works I am guessing that I am not following all best practices ...
3
votes
1answer
36 views

A storage bin thingy for Repl.it projects

I have a Repl.it account that I use for my projects, and I don't really want to make a new api for storage every time, I've seen some like EasyDB and Jsonstore (I use Jsonstore in the background as ...
3
votes
0answers
156 views

Is this a good way to process SQLAlchemy's uniqueness constraint violation in Flask?

I'm using Flask along with Flask-SQLAlchemy and Flask-WTF. I have a model: ...
3
votes
1answer
44 views

Jinja2 block that is unreadable [closed]

I have a block of Jinja2 (used in Sceptre/CloudFormation). It is not readable in my opinion, but I can't find any way to clean it up to improve it. ...
1
vote
0answers
960 views

Anything Wrong with This Method of API Versioning Using Flask?

I'm trying to find a sensible way to structure a REST API written in Flask. I'm new to writing such things and I've not seen this structure used anywhere else, so before I continue I wanted to ask ...
0
votes
1answer
114 views

Website for allowing data evaluation from submission

I'm making a really basic website where users essentially just submit data into some forms and they will be able to review their data in another page. I feel like I'm going to be repeating myself far ...
5
votes
0answers
319 views

what is the correct way to write an endpoint?

Here is a rather large endpoint that I have written in Python using Flask and SQLAlchemy, I was wondering if there are any tips I could get. The endpoint takes a post request which contains specific ...
5
votes
0answers
370 views

Docker-compose for task-based Flask API with Redis and rq

I am not a Docker guru or expert in Flask or Redis. However, I need to leverage these technologies. I managed to cobble something together that works and would like to submit it for review. The MWE ...
6
votes
1answer
253 views

Flask application for buying stocks

I wrote three Flask views below. First view input stock code Second view get the stock details (name, price) of the stock by using 3rd party api get the balance cash of DB and show to the view ...
7
votes
3answers
119 views

Blog with Python/Flask

I've written a blog site using python and Flask. It works a little like Reddit, but instead of having some anonymous users, ...
6
votes
1answer
1k views

Python/Flask Password Manager

As a project to better my skills in Python, I wrote a password manager. It's a website that has user login/logout functionality, the ability to add websites and passwords, and displays the websites/...
3
votes
0answers
88 views

Sending push notifications to a user

I have a function whose responsibility is to send a push notification to a user. I call this function from a view in flask framework. I have read multiple articles around refactoring and good designs ...
4
votes
0answers
43 views

Form deserializer for Python Flask

I've started working on a small Flask project for no real reason other than fun, and pulled myself back on form validation. I realize that there are existing libraries like WTForms, but wanted to try ...
4
votes
1answer
67 views

Account automation through Python (with Flask) and javascript

This is my first time doing a code review so I expect a ton of criticism on this from all you professionals. What am I doing? I'm using python with flask to create a service for my web server. My web ...