Questions tagged [flask]

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

Filter by
Sorted by
Tagged with
20
votes
1answer
286 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
7k 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
2k 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
6k 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
1answer
39k 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
2answers
246 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
256 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
279 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
98 views

Mail utility class for use with Flask

...
7
votes
1answer
830 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
184 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
499 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 ...
7
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 ...
6
votes
2answers
611 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: ...
6
votes
1answer
314 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
255 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
329 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 ...
6
votes
1answer
181 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
1k 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
824 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
285 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
293 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
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 ...
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 ...
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
309 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
4k 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
2answers
225 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
451 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
52 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 ...
4
votes
1answer
408 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
1answer
130 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 ...
3
votes
1answer
1k views

Flask brand API endpoint unit test

...
3
votes
2answers
671 views

Conditionally inserting MySQL entries in a Flask app

I am a newbie in back-end developing. I know that the biggest part of back-end development is interaction with database. I established a connection and the code is 100% working, but I am wondering if ...
3
votes
1answer
2k views

Flask form validation technique

This is currently the code that I'm using to validate and check for errors in a flask app, where the form fields are coming from a /registration html page: ...
3
votes
3answers
868 views

Flask route to pull data from database for getJSON to process

I am developing a reporting application in Flask where I pull data in a route function from a postgresql database and jsonify the data. On the client side I have ...
3
votes
1answer
102 views

Catching API changes for a service that doesn't version its API

I'm using the old Google Data API to access several spreadsheets and put their contents in a database using Flask and SQLAlchemy. Each run deletes the contents of the database tables and repopulates ...
3
votes
1answer
913 views

Slow Flask-SQLAlchemy query using association tables

I have two models in Flask-SQLAlchemy (Post and Comment) that have many-to-many relationship that is manifested in the third model (post_mentions): ...
3
votes
1answer
50 views

Handling Many Unexpected States with except

I am creating a server with Flask and it has quite a few routes. Most routes require a specific state, such as "logged in" or "process started". All of my functions and methods in packages will throw ...
3
votes
1answer
2k views

Applying dynamic filters to a SQL query using Python conditional expressions

I wrote this piece of code to eliminate the need for multiple if then statements based on the filters from the incoming REST request. If the request has category ...
3
votes
1answer
2k views

Python RESTful image handler

This is a view as part of a RESTful image handler module, written for Flask, I am sure there is a better/more pythonic way of doing parts of this, maybe using List Comprehensions or Generator ...
3
votes
0answers
25 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 ...
3
votes
1answer
76 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....
3
votes
0answers
1k 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
0answers
238 views

Flask-SQLAlchemy model structure

I'm seeking a review of my Flask-SQLAlchemy model structure, particularly adherence to DB best practices, such as avoiding duplication, etc. The models represent the relations between Departments, ...
3
votes
0answers
235 views

My live monitoring web app (Flask, guicorne, heroku, and redis) is spamming the source website

As a student, I am working on a project where I need to forward data from an already existing website to a new one, with the data presented in a different manner. In order to do so with my mediocre ...