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
351 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 ...
1
vote
1answer
67 views
1
vote
0answers
27 views

Safely log-in and save login info into session [closed]

I would like to ask if this code is safe for user to log-in (save ID to session) and check if user is log-in when visiting site (Dashboard). ...
1
vote
0answers
844 views

Flask app for control TCP server

This snippet allows to up and down TCP server via Flask endpoints. I'm seriously concerned about global variables here. And asking for review this code. The main idea is to be able to up/down TCP ...
1
vote
0answers
22 views

Deletion button on a website that enforces database integrity

I am designing a website on which users can configure (CRUD) various objects which are mutually dependent upon other types. I am preventing a cascade delete, so let's say a ...
1
vote
0answers
382 views

Log visitor info like latitude, longitude to a database

I am collecting each visitor information like ip, lat, longitude, referrer and language and save it into db, then in db I have column in table with counter that increment if user revisits the web site ...
1
vote
0answers
38 views

API separate request vs logic

Is it a good practice to separate Logic from Request controller in an Api ? Without separation: ...
1
vote
1answer
240 views

Models in a Simple PyMongo-based Blogging Web App without ORM/ODM

I am currently using PyMongo + Flask for building a simple blogging application. I am not using any kind of ODM, instead I decided to use PyMongo directly. I need to know how to improve my code since ...
1
vote
0answers
815 views

Python - Flask Middleware - Request Session Management Strategy

I am trying to determine what the most appropriate strategy for session management and authentication is for a middleware application which acts to receive a request, send it over to a database, and ...
1
vote
0answers
797 views

Parse query filter expression from request URL

I am building a backend APi for which I need to extract query filters from request URL of following pattern: ...
1
vote
0answers
519 views

Alternative session token implementation in flask

Here is my implementation of an alternative session token. The idea is to reset session_token every time get_id is called, so (I ...
1
vote
0answers
369 views

Run a potentially long running application from within a Python webserver and return different results depending on whether the application finishes

I want an API on a Flask/Gunicorn webserver to make a call to a separate, potentially long-running java application. If the java application finishes before the Gunicorn timeout, Flask should return ...
1
vote
0answers
259 views

Flask json rpc2.0 extension

I created a simple extension to handle JSON RPC 2.0 requests on flask I would like some feedback regarding usage here is an usage example: ...
0
votes
2answers
3k views

Simple web based file browser with Flask

I made a simple web-based file browser with Flask. It also shows some metadata of a file. I have a few questions regarding security though. Is it possible for an attacker to escape out of the preset ...
0
votes
1answer
153 views

Creating a proper workflow through version control and a Makefile

disclaimer: I've posted this around but the question keeps being put on hold for being inherently opinionated which I understand, just looking for some vague direction as to how a more experienced ...
0
votes
1answer
719 views

How to optimize the Flask RestFul api

The tutorial is here I want to build a RestFul API with Flask to query User Agent data. Curl script shows below. The api should work with three or two or one or even zero argument. So how to change ...
0
votes
0answers
45 views

Inserting data from client-side to MySQL via Flask-Sqlalchemy

I am creating a Bill of Materials (BOM) web app with flask as a backend. As a part of this app I am inserting data into BomStructure table from ...
0
votes
0answers
29 views

buying stock module - nonlocal vs global variable or others? [duplicate]

[Background explain] I wrote three Flask views and module interact with the views. I do this one module called /buy using different scenario cases based on flag. Zero view if user come in GET, ...
0
votes
0answers
128 views

Dynamically configurable ZMQ filter with Flask API

I have a stream of ZMQ messages, I need to filter the right ones and save them in MongoDB. The trick is to have an option to set the filter conditions dynamically. I have come up with this solution ...

1 2
3