Questions tagged [flask]

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

Filter by
Sorted by
Tagged with
22
votes
1answer
353 views

Raspberry PI controllable Christmas Tree

After having the scales, thermometer and a coffeemaker connected to the internet, it is finally time for Christmas Tree to become smarter. Hardware 6ft Christmas Tree An addressable WS2811 LED strip (...
14
votes
1answer
8k views

Flask-SQLAlchemy models and unit-testing

This is my first time building anything remotely like a robust database. I'm midway through designing it and I would be grateful if you have suggestions or have found any logical errors. Goal: allow ...
12
votes
2answers
3k views

A website status monitor in Python/Flask

I've written a basic website status checker in Python/Flask which reads a list of URLs from a json file and cycles through them every x seconds to check they're online. It displays the results as a ...
11
votes
1answer
7k views

Python GUI by QtWebkit and Flask

I'm new to Python. For learning purposes, I want to create desktop application by using QtWebKit and Flask. You can find the source code here Main idea is: create a form including a QWebview widget ...
10
votes
1answer
2k views

Multi-dictionary API using Python Flask-RESTful

I'm working on a simple online dictionary tool, using Python Flask-RESTful as the RESTful API backend. The dictionary tool is modular, it can handle multiple dictionaries, implemented as independent ...
8
votes
2answers
262 views

Trending Machine Learning topics for Alexa

I've created a small Flash Briefing Alexa skill that reports the top 5 trending topics in Machine Learning from the My Bridge service. The feed for the Flash Briefing skill can be pointed to an ...
8
votes
1answer
44k views

Simple login system using Python Flask and MySQL

I've made a login page using Python Flask which works with MySQL. I started learning Flask 2 days ago and it was fun, so I came up with this: ...
8
votes
1answer
332 views

Python function to implement an image-processing pipeline

I have written the following function to process images. Now I am not sure if it's pythonic or considered as spaghetti code. I know being flat is better than nested, but I don't see a way around it. ...
8
votes
1answer
323 views

Extension pattern in a flask controller using importlib

I am trying to load a module according to some settings. I have found a working solution but I need a confirmation from an advanced python developer that this solution is the best performance wise as ...
8
votes
1answer
101 views

Mail utility class for use with Flask

...
8
votes
0answers
1k views

Flask view dependency injection

so, first of all, I've been into trying to have a simple dependency container as possible in python and with your help managed to get conceive https://github.com/dareenzo/tinydic, many thanks. Now, I ...
7
votes
2answers
1k views

A simple library using Flask and SQLAlchemy

This is the main.py script that does most of the work of Adding movies (Movie objects) as well as modifying and removing: ...
7
votes
3answers
109 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, ...
7
votes
1answer
340 views

Getting prices of crypto coins

I have been working on this Raspberry Pi project for a while. It uses the Poloniex API to get prices of crypto coins and it shows the prices on multiple OLED displays. The displays use different i2c ...
7
votes
1answer
1k views

Saving temporary file for plotting audio waveform

I am developing a web application in Flask - Python. My goal is to let the user upload an mp3/wav file. This file will (for the scope of this question) get processed by the server and a picture ...
7
votes
1answer
202 views

Python Flask webserver with small features

With the latest of my projects, I started using Visual Studio Code, which allows for Python linting and also checking for poor practices, such as using over 100 characters in a single line. As you ...
7
votes
1answer
505 views

Subclassing Flask for Permissions with Google App Engine

I'm trying to set up a very lightweight permission system using Google App Engine and Flask. The end result I am hoping for is that each individual view is its own permission, and in an admin panel ...
6
votes
1answer
518 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/...
6
votes
1answer
316 views

Contest assist web app

This is a small web application that I have created using the Flask framework. I am looking for best practices feedback, as well as design pointers. I am not confident that my design choices have ...
6
votes
1answer
98 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 ...
6
votes
1answer
424 views

PyFladesk Migration

I wanted to contribute to the PyFladesk project. The objective is to have a function that receives a Flask's app and embeds it in a Qt desktop app. I've already create a Pull Request on the main ...
6
votes
1answer
187 views

Simple Flask API backend to maintain a word list

I made a little toy project last semester. I would like to get some insights about my code, particularly the part of handling the database. It is a CRUD kind of traditional API. ...
6
votes
0answers
2k views

Improving the Flask cache decorator

In my rumblings developing flask applications I found the caching decorator. The decorator is a short and well-written piece of code, but I feel like it misses the few points bellow: It only caches ...
5
votes
2answers
2k views

Security of simple client/server desktop app

I am writing an application aimed at the desktop but using web technologies. It will have an HTML interface and a server written in Python using Flask will do all of the filesystem interaction. It ...
5
votes
2answers
860 views

RESTful APIs (Create, Read) with flask-restful

I wrote this simple API to be able to send logs from the client to MongoDB. Even though this works and fits my need, I would like to point out some concerns that I have regarding the following: Is ...
5
votes
1answer
506 views

Authenticating an internal API with Flask

I'm developing an internal API using Flask, although due to limitations with our platform the endpoints will be accessible over the public internet. It will only have a very small number of users and ...
5
votes
1answer
301 views

Flask Framework - user sign in

These functions are more or less the same. They are doing the sign in process for a flask application. A user is retrieved from a database (identified through email address) and the password is ...
5
votes
1answer
1k views

Is this implementation for token based authentication in flask-peewee secure and efficient?

I'm making an app with a Flask API backend using a Flask-Peewee ORM and an AngularJS frontend. The Flask-Peewee ORM doesn't support token based authentication, so I decided to try to implement this ...
5
votes
0answers
251 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
188 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 ...
5
votes
0answers
57 views

Building a form for rebooting many network devices

I have several IP based devices that, due to building maintenance, occasionally lose their communication with the other devices. Normally you'd have to find the device IP, go to its control page and ...
4
votes
2answers
2k views

Authentication for a Flask API

I've written a couple of functions to check if a consumer of the API should be authenticated to use it or not. Have I done anything blatantly wrong here? Config ...
4
votes
1answer
52 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: ...
4
votes
1answer
344 views

Fetching Python news headlines for Alexa

I've recently added a custom Alexa Flask Briefing skill that calls an API endpoint which scrapes top news headlines from the Planet Python RSS feed. It works - whenever you ask Alexa about the news, ...
4
votes
1answer
5k views

How to better indent multiline strings with many string formatting args?

I have a function, that is used in flask, for logging application errors: ...
4
votes
1answer
3k views

Website menu with Flask

I wrote some code in Flask for site menu: ...
4
votes
1answer
631 views

Flask web application, with handling for user login status

I am trying to change some variable in base html-template which other html pages inherite from after entering user in personal account. The idea is as follows: there is base html template and there ...
4
votes
2answers
245 views

Kik bot made using Flask

I created a Kik messenger bot using Flask microframework and python that accepts POST requests on the provided webhook and then responds appropriately. I have excluded custom module imports because ...
4
votes
1answer
2k views

login_required decorator in Flask

I have 2 Flask apps (different projects) that work together . One implements some API which uses tokens for auth. The second one consumes the API and makes a web interface for it. Now I have a login ...
4
votes
1answer
492 views

Caching a function view for a day

I am writing a flask app that I will deploy it on Heroku to test it. There is a page that will generate daily photos and information based on a JSON file. The view is valid for 24 hours beginning from ...
4
votes
1answer
109 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
1answer
60 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 ...
4
votes
1answer
140 views

Flask Database Model Design

I am developing my first website in Flask using PostgreSQL and I want my database to have professors from all universities and courses in the USA. As I am not very familiar with databases I have ...
4
votes
0answers
72 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 ...
4
votes
0answers
38 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
102 views

Python Flask website

I'm new to programming and in back-end. Right now I'm trying to learn flask, so I wrote a very simple website that currently encrypts and decrypts the message using RSA and DES. I feel like my app....
4
votes
0answers
2k views

REST API with flask structure and implementation approach

I recently started writing REST API, I wanted to have a proper structure of project and an approach which is more readable and make more sense interms of organising in a logical order. I took ...
3
votes
1answer
34 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
1answer
2k views

Flask brand API endpoint unit test

...
3
votes
1answer
200 views

SQLite database for a micro/tumble blog application

I'm creating a personal website where, among other things, there is a blog, or a "microblog" (I'm still not sure how to define the two), where I will be writing articles and having users, who will ...