14
votes
Accepted
Raspberry PI controllable Christmas Tree
I would suggest to separate the concerns of coloring and animating. Now, in particular theater_chase_rainbow duplicates code from other methods. Instead, have ...
8
votes
Accepted
Python/Flask Password Manager
Disclaimer: I haven't done authentication in Flask before.
Tl;dr: Don't do authentication yourself, it's VERY hard to do right (and using a global ain't right); also, separate the user's ...
6
votes
Accepted
Python function to implement an image-processing pipeline
As Reinderien mentions, you can decrease some of the complexity of your code by inverting your if-statements. While I cannot test this because I do not have your whole code, here is how it could be ...
5
votes
A simple library using Flask and SQLAlchemy
Document with docstrings.
Your functions and ORM models are currently not providing any useful documentation regarding their respective function within your program.
Don't initialize the database on ...
5
votes
Python Flask, best way for users to update profile details
At the least, this can be done more efficiently:
...
5
votes
Accepted
Flask App: ML Project on Predicting Weather
High level advice: helper functions are your friends, use lots of little ones.
defer execution
This runs at import time:
...
4
votes
Accepted
Blog with Python/Flask
Date formatting
self.date_created = f"{now.month}/{now.day}/{now.year} {now.hour}:{now.minute}:{now.second} {end}"
should be
...
4
votes
Accepted
Authenticating an internal API with Flask
Just because you don't have many people using this API now, this does not mean that this will always be the case.
In addition, you might want to discriminate between the users of the API for various ...
4
votes
Accepted
Fetching Python news headlines for Alexa
You probably want to move the session to a global variable(or simply use requests.get) else at function level it is not helping in re-using any connections right ...
4
votes
on using the strategy pattern to switch between database layers
Typically you'd have two classes that implement the four methods create, read, update and delete, one for Mongo and one for ...
4
votes
Accepted
on using the strategy pattern to switch between database layers
The short answer is: You don't need the strategy pattern here. just do as nullTermiator said in his answer.
To understand why strategy does not fit here, first we need to understand the problem ...
4
votes
Accepted
URL shortener using Flask
I do have a few comments:
Handling Non-Unique Digests
It's good that you recognize that digests such as MD5 are not guaranteed to be unique. But, although you have ...
4
votes
Flask web normalizer CSV app
Disclaimer: I haven't run your code, so this is a static analysis exercise based on what I have noticed while perusing it.
Routes
This method only accepts GET requests:
...
3
votes
Accepted
Getting prices of crypto coins
Well, I shall start from the top.
According to the style guide, PEP 8 imports should be in the following order:
standard library imports
related third party imports local
application/library ...
3
votes
Accepted
Flask Framework - user sign in
There are a few things bothering me in one version or an other:
the error=error or None is unnecessary as error is either ...
3
votes
Accepted
A storage bin thingy for Repl.it projects
Few optimization tips
verify_password function
avoid bare except: clause - at least use ...
3
votes
Weather Forecast Web Application
URL
URL components should generally appear from "broadest to narrowest" left-to-right. I'm not totally convinced that this is currently the case - the weather site is probably "broader&...
3
votes
Accepted
Python Rubiks cube solver - general code comments
You should put your Configure Memcache section into a function to clean up the global namespace, even if you unconditionally call it from the global namespace.
...
3
votes
Accepted
Read and display JSON results from Google Books API
Split search() up into two functions, each accepting only one method, and dispose of your if.
There's a little bit of religion ...
2
votes
Accepted
PyFladesk Migration
I’m not too found of putting it all into a single method as:
it seems to have too much responsibilities;
building some objects (QThread, ...
2
votes
Accepted
Flask web application, with handling for user login status
Despite html code indeed looks nice, is there where you want to point out your efforts
Jinja supplies conditional blocks (like in python) where you can define which buttons you want to appear on ...
2
votes
Accepted
A simple library using Flask and SQLAlchemy
Your database management is kind of a mess:
SQLAlchemy recommend to keep your sessions scope the same than your requests scope;
Having a single, global, ...
2
votes
A website status monitor in Python/Flask
This looks like a very good status page. Well done !
Review
from settings import refresh_interval, filename, site_down
I recommend that you use set of config ...
2
votes
Flask application for buying stocks
Unclosed Connection
Your dbexe method has a bug. If the elif statement is executed, tupdata ...
2
votes
Accepted
2
votes
Accepted
9X9 Tic Tac Toe variant with frontend in react and backend in python flask_socketio
I'm not fantastic with Typescript; so let's take a look at your Python:
Credentials
app.config['SECRET_KEY'] = 'secret!'
This shouldn't be baked into your code. ...
2
votes
Accepted
How to make the filtering queries more efficient using flask sqlalchemy?
I think this should work:
...
2
votes
Accepted
Track the existence of process
There is nothing I can test here, so I will only make a couple superficial remarks.
You do not offer a lot of insight into your application. If you say you have a problem with overlapping queries, ...
2
votes
Air Quality/Environment Monitoring Web App using Plotly Dash
I have no experience with any of these libraries, so I can only comment on aspects of the language itself.
...
2
votes
Accepted
Flask app to return close prices & average
Relays
Your current design:
fetches data from alphavantage once, on startup
offers it to anyone who hits any of your interfaces on port 5000 (which, by the way, is already used by a large number of ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
flask × 145python × 143
python-3.x × 28
sqlalchemy × 20
beginner × 12
api × 10
authentication × 10
object-oriented × 7
javascript × 6
rest × 6
mongodb × 6
json × 5
sqlite × 5
unit-testing × 4
session × 4
performance × 3
jquery × 3
html × 3
design-patterns × 3
security × 3
validation × 3
web-scraping × 3
database × 3
machine-learning × 3
web-services × 3