r/flask

▲ 4 r/flask

a flask app i built for a friend's rental business is now used by 5 investors and the whole thing is one file

a buddy who buys rental properties kept asking me to look up numbers for him. zestimate vs asking price, estimated rent, cash flow at different down payments. he was doing this on zillow manually like 10 times a morning and texting me screenshots asking "do these numbers work."

i told him i'd build him something over a weekend. reached for flask because i just needed a form that takes an address, hits an api, and shows the results. didn't need anything fancier than that.

the backend is one file. about 80 lines of actual logic. a route that takes the address from the form, calls a rest api called zillapi that returns zillow data as json, calculates a simple deal score based on rent-to-price ratio and zestimate gap, and renders a template with the numbers. that's it.

i added a second route that saves properties to a sqlite database so he can track ones he's watching. and a third route that loops through saved properties and refreshes the data. i run that one manually with a cron job on my server every sunday.

the deal score is basic. if the rent-to-price ratio is above 0.8% and the asking price is below the zestimate, it's green. if one condition is met, yellow. neither, red. my friend said this alone saves him 30 minutes every morning because he can scan 15 properties in one glance instead of opening 15 zillow tabs.

he showed it to guys at his real estate meetup and now 5 investors use it. i added flask-login with a simple user table and foreign keys on the saved properties. multi-tenant in like 20 lines.

for the ai side i set up a skill so they can ask claude about their saved properties:

npx clawhub@latest install zillow-full

total cost is a $5/month digitalocean droplet running flask + sqlite + nginx. handles all 5 users doing maybe 50 lookups a day total. no queue, no background workers, no orm beyond raw sqlalchemy core.

i keep thinking i should rewrite this in something with async or add celery for the refresh job but honestly why. it works. nobody's complained about speed. the refresh takes 40 seconds for all saved properties across all users. flask is doing exactly what it's supposed to do.

reddit.com
u/straightedge23 — 15 hours ago
▲ 0 r/flask+1 crossposts

About to build a productive tool with help of Flask backend. Need your suggestions.

I am thinking of creating an app that enhances YouTube as a learning tool rather than distraction with:

  1. AI powered summaries

  2. Spaced learning cards

  3. Quizzes

  4. Ranking top mentors/teachers for various niches.

Your comment can help me understand the need & features better.

reddit.com
u/Tom-Miller — 13 hours ago
▲ 16 r/flask+2 crossposts

built this for flask + SQLAlchemy codebases because existing SQL linters only see .sql files, which is useless when the SQL doesn't exist until runtime, or they are AI garbage tools

valk-guard reads the python AST, walks SQLAlchemy chains (session.query, select, filter, join), reconstructs the SQL the ORM will generate, parses it with a real postgres grammar, runs 19 rules. catches DELETE/UPDATE without WHERE, SELECT *, leading wildcard LIKE, CREATE INDEX without CONCURRENTLY, plus schema drift between models and migrations.

deterministic. no LLM, no DB connection. runs in CI in seconds.

postgres only. SQLAlchemy 1.x works, 2.0 mapped_column half-done+ SQL migration file

https://github.com/ValkDB/valk-guard

would appreciate feedback from anyone running flask + SQLAlchemy in prod, especially on patterns you think this would miss.

u/Eitamr — 3 days ago
▲ 12 r/flask

Problem with Flask

A few months back I created a website. Used "webhostpython.com" for the host. And I used python Flask for the backend, while in localhost, the website was incredibly fast at loading which makes sense. however, when I launched it publicly, the website was incredibly slow, without the cache, the website would take more than 10 seconds to load a single page. Now I am about to work on another website and I don't want to have the same failure that will cost me a lot. What did I do wrong to make it so incredibly slow?

reddit.com
u/Moist-Decision-1369 — 7 days ago
▲ 12 r/flask+1 crossposts

Finished my CS50 Final Project (VORTEX) — looking for feedback and advice on what to do after CS50

Hey everyone,

I just finished my CS50 final project: VORTEX.

It’s a Flask-based e-commerce website I built for a real clothing brand project owned by a friend of mine, and it’s already running online with a few products.

GitHub: https://github.com/bassam-alaraby/vortex

Main things I used/worked on:

  • Flask
  • Turso database
  • Cloudinary uploads
  • Telegram order notifications
  • Admin dashboard
  • CSRF protection + rate limiting
  • Vercel deployment

Before CS50, I honestly never thought I’d be able to build something like this from scratch. Working on a project that people can actually use made me learn way more than I expected.

Took me way longer than I thought honestly 😅 but I’m really happy I pushed myself to finish it.

Now that I’m almost done with the course, I wanted to ask: What do you think is the best next step after CS50?

I also wanted to ask: What exactly should I do next to officially complete CS50 and receive the certificate?

Also, if anyone has feedback on the project or code structure, I’d really appreciate it. Still a lot to improve obviously.

u/Bsam_Al_Araby — 7 days ago
▲ 0 r/flask

I built a Django-style query manager for SQLAlchemy — useful for Flask apps?

I built sqlalchemy-query-manager, a small package that adds Django-style query ergonomics on top of regular SQLAlchemy models.

I wanted this for backend apps where I kept writing the same filtering, relationship lookup, eager loading, and CRUD boilerplate.

Example:

items = (
    Item.query_manager
    .where(
        Q(is_valid=True) | Q(number__gt=100),
        group__is_active=True,
    )
    .select_related("group")
    .order_by("-number")
    .limit(20)
    .all()
)

What I tried to keep:

  • regular SQLAlchemy models underneath
  • no replacement for SQLAlchemy
  • readable app-level queries
  • inspectable SQL

Main features:

  • Q objects
  • Django-style __ lookups
  • relationship filters
  • select_related / prefetch_related
  • CRUD helpers
  • aggregates
  • raw SQL helpers
  • SQL query preview
  • sync and async support

Source code: https://github.com/ViAchKoN/sqlalchemy-query-manager

Question: would this be useful in your cases?

Any feedback or criticism would be appreciated.

u/IaMaPPle111 — 9 days ago
▲ 31 r/flask+1 crossposts

Python Flask & Django

Which is best tell me Flask ya Django. Currently i am learning flask

u/Bumbble25 — 12 days ago
▲ 1 r/flask

How to deploy flask app on Windows server or containerized app on Windows using WSL 2

Have one computer that running Windows 24/7 and wont to deploy flask app there

Flask app is website that made for around 2000 users total and processing data and documents

I tried to run on VPS for one month

First with direct flask run and

second time with docker container

But, leveraging that Windows computer for trying to run that flask app

What I choose

- directly run flask app

- use container

- or any other solution that work with Windows

reddit.com
u/thankyoucode — 11 days ago
▲ 4 r/flask+1 crossposts

I built a Python tool to transfer personal files off my work laptop - Do you have same situation?

I spent years using my office laptop for personal things alongside work. When I finally needed to move everything to my personal machine, I couldn't find a tool that was simple enough — so I built one.

What My Project Does

laptop-file-transfer-pro is a single-file Flask web app you run on the receiving machine. Any other device on the same WiFi opens the URL in a browser and can drag & drop files directly across — no installation, no cloud, no accounts needed on the sending side.

Also, in later years, everything got blocked on office laptop - cloud, personal email access, USB, network sharing, no outbound email etc.

Key features:

  • Drag & drop upload with a real progress bar (XHR with onprogress, not a fake spinner)
  • Upload multiple files in one request — large file support up to 4 GB by default
  • File listing with size, upload date, download link, and one-click delete
  • Extension whitelist + werkzeug secure_filename (path traversal protection)
  • Duplicate filenames get a timestamp suffix instead of silent overwrite
  • Optional Basic Auth via two environment variables (LFT_USERNAME / LFT_PASSWORD)
  • Structured logging — every upload, download and delete logged with client IP
  • /health endpoint returning JSON status
  • All config via environment variables — no code edits needed
  • Zero frontend dependencies — pure HTML/CSS/JS, works on any device
  • 30 pytest tests

GitHub: https://github.com/learneramit2020/laptop-file-transfer-pro

Target Audience

Personal / home use on trusted local networks. This is not a production tool — it uses Flask's built-in dev server and has no HTTPS by default, which is fine for a home WiFi transfer between your own machines but not for anything internet-facing.

The target user is someone who needs to move their own files between two machines on the same network and wants something they can clone, run in 30 seconds, and trust because the code is short enough to read in one sitting (~350 lines including the HTML template).

Comparison

Tool Requires install on sender? Cloud involved? Progress bar? Open source?
laptop-file-transfer-pro No (just a browser) No Yes Yes
Snapdrop / PairDrop No Relay server No Yes
Python http.server No No No Yes
Wormhole (magic-wormhole) Yes (CLI) Relay server Yes Yes
Syncthing Yes No Yes Yes

The closest comparison is python -m http.server, which is what most developers reach for. The differences: http.server only serves files from the machine it runs on — it can't receive uploads. This app is specifically built for the upload direction, with a UI, progress feedback, security hardening, and a proper extension whitelist.

PairDrop/Snapdrop are excellent but route traffic through a relay server (or require self-hosting). This app is purely point-to-point on your LAN — nothing leaves your network.

Syncthing and magic-wormhole are more powerful but require installation on both machines. This needs nothing on the sending side beyond a browser.

This is also my first published GitHub project — happy to take feedback on the code, the approach, or anything else.

u/learneramit2020 — 12 days ago
▲ 2 r/flask+1 crossposts

Python Flask

Flask is the ideal balance of flexibility and power. It’s lightweight enough for beginners to not feel overwhelmed, yet robust enough to scale with complex logic.

However the Python in Python Flask is not optional; your ability to build great APIs is directly tied to your grasp of core Python fundamentals.I am currently building my own web App using Python Flask. What do you think about Python Flask write down in comment.

reddit.com
u/Bumbble25 — 13 days ago
▲ 18 r/flask

i built a calculator

jokes aside i am trying to build a reactive gui based on flask, partials, jinja and tailwind. so far i have some event loops working, its called shadowgui, follow me, to see when i make it public.

u/wannasleeponyourhams — 12 days ago