A selfhosted web app built with plain Python
### What My Project Does
- Code: https://github.com/daya0576/beaverhabits/
- Demo: https://beaverhabits.com/demo/
When switching from Android to iOS, I was unable to find a light-weighted but handy habit tracking app, so I decided to make one by myself :p
The project's name (Beaver Habit Tracker) came from a game called "Against the Storm" (which I spent over 200 hours, highly recommended). In the game, my favourite species is the beaver, hoping this web app works as a beaver to record ur precious moments in your fleeting life.
---
### How the Project was Developed
Inspired the idea of "web UIs with plain Python" from Three Python trends in 2023, I developed a web app with 100% pure Python <3
The app is powered by an out-of-the-box framework called NiceGUI (including Quasar, Tailwind CSS, FastAPI, ...).
Some thoughts to share after several months of development:
- Good things ✅
1. WebSocket based communication between client and server, works perfectly with Python asyncio
2. Light-weighted session based storage provided, out of the box to use
3. Plenty of UI components provided, straightforward and highly customizable
4. ...
- Disadvantages:
1. The framework NiceGUI follows a backend-first philosophy: It hadles everything on the server side -> network latency could
/r/Python
https://redd.it/1giizja
How Do You Know When Your Project Idea is The One?
I’m curious about how other developers decide when a project idea is worth fully committing to. You know, that moment where you think, “This is it. This could be big,” and feel driven to go all-in and working on it nonstop.
For those who have had that experience how did you know this was the idea? Was it a response you got from potential users, or maybe just a gut feeling? And if you did go all in, how did it go?
I’m working on some ideas of my own and trying to figure out when to know if one of them has real potential. I’d love to hear your stories and any advice you might have.
/r/djangolearning
https://redd.it/1gif6o1
Robyn finally supports OpenAPI/Swagger
Hey Everyone 👋
We just launched OpenAPI docs generation in Robyn. - https://github.com/sparckles/Robyn/releases/tag/v0.63.0
(For the unaware Robyn is a Super Fast Async Python Web Framework with a Rust runtime. )
It was one of our community's most requested features, and I hope you all will like it.
Do let us know what you think of it 😊
You can find the docs at - https://robyn.tech/documentation/api\_reference/openapi
/r/Python
https://redd.it/1gieai3
Sunday Daily Thread: What's everyone working on this week?
# Weekly Thread: What's Everyone Working On This Week? 🛠️
Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
## How it Works:
1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.
## Guidelines:
Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.
## Example Shares:
1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
/r/Python
https://redd.it/1gia4ox
What would Enaml 2.0 look like? | nucleic/enaml | Declarative UI
From Enaml's docs:
> Enaml brings the declarative UI paradigm to Python in a seamlessly integrated fashion. The grammar of the Enaml language is a strict superset of Python. This means that any valid Python file is also a valid Enaml file, though the converse is not necessary true. The tight integration with Python means that the developer feels at home and uses standard Python syntax when expressing how their data models bind to the visual attributes of the UI.
> . . .
> Enaml’s declarative widgets provide a layer of abstraction on top of the widgets of a toolkit rendering library. Enaml ships with a backend based on Qt5/6 and third-party projects such as enaml-web and enaml-native provides alternative backends.
---
A maintainer of Enaml has just opened a brainstorm discussion on the next major development goals.
It's a project I've long admired, though rarely used, and I'd love to see it get some attention and a revamp. I think the bar these days has been raised by projects like QML and Slint, which provide a great context in which to set new goals.
/r/Python
https://redd.it/1gi2vwa
I discovered context processors
Today I discovered context processors, basically I needed a variable to be globally accessible across all the templates, and wola Django has a built-in and elegant solution.
I love this tool so much!
/r/django
https://redd.it/1ghxoy8
Run a command, then stream the stdout in real time?
Been researching how to do this and simply couldn't get any of the answers / idk if they are even relevant to me.
I have a command that runs after a POST to the server, via `subprocess.run`. Let's just say it's `ping -c 100 8.8.8.8`.
import subprocess
u/app.route("/whatever", methods=["POST"])
def whatever():
proc = subprocess.run(
"ping -c 100 8.8.8.8",
shell = True,
capture_output = True
)
I want to receive the stdout of that command from HTTP(S), appearing in real time as they come. I'm fine if we're just checking stdout every, say, 5 seconds, as long as the output is sent to the user as it
/r/flask
https://redd.it/1gi0vjs
Projects for open source contributions
I am a junior developer currently and I am interested in contributing to some good, impactful open source projects that are making people's lives easier. I am primarily looking for projects in Python and Django to contribute to.
Can I get some recommended projects, especially in django (or django-rest for that matter). Since I'm a beginner and do not have a rich experience (especially in large-scale projects) I would like to be recommended projects that are not so daunting (like django itself) :)
/r/django
https://redd.it/1ghpb2r
Any flask github suggestion
I'm currently learning Flaks and i want to improve my quality of code.
Do you have any good repo to look for ?
/r/flask
https://redd.it/1ghcthh
Feature Friday: LoginRequiredMiddleware!
The LoginRequiredMiddleware
(new in Django 5.1) is great for any Django app that is mostly behind authentication. When enabled, views will require login by default. No more login_required
decorators everywhere!
So how do you make a view not require login?
Use the new login_not_required
decorator! This works just like the login_required
decorator but for the opposite: any view it decorates will bypass the login requirement and be public. Be sure to put it on your login page otherwise you might get caught in redirect loops!
If you're building an app that mostly requires login, using the LoginRequiredMiddleware
is a great way to simplify code and prevent accidentally leaking content—by making your app private by default.
Read more in the documentation here: https://docs.djangoproject.com/en/5.1/ref/middleware/#django.contrib.auth.middleware.LoginRequiredMiddleware
/r/django
https://redd.it/1gh51ai
State of the Art Python in 2024
I was asked to write a short list of good python defaults at work. To align all teams. This is what I came up with. Do you agree?
1. Use uv for deps (and everything else)
2. Use ruff for formatting and linting
3. Support Python 3.9 (but use 3.13)
4. Use pyproject.toml for all tooling cfg
5. Use type hints (pyrite for us)
6. Use pydantic for data classes
7. Use pytest instead of unittest
8. Use click instead of argparse
/r/Python
https://redd.it/1ghiln0
Handling errors with OOP
I'm currentrly trying to create a bank system using OOP with Flask, I wanted that when the if statement that I underlineded in the screenshot goes false, it should redirect the user to a "failure operation" page or something like that.
https://preview.redd.it/mjzdaqgp0cyd1.png?width=509&format=png&auto=webp&s=a0793a592fc091fd2359341d175794c8d1b6a825
https://preview.redd.it/4trn3xte0cyd1.png?width=497&format=png&auto=webp&s=c7cb19bac027aa8111bbf83a6600ccf16022d530
/r/flask
https://redd.it/1ghct6x
Automate your releases with the Jupyter Releaser 🚀
https://blog.jupyter.org/automate-your-releases-with-the-jupyter-releaser-701e7b9841e6
/r/IPython
https://redd.it/1gh54qp
I Wrote a Guide to Simulation in Python with SimPy
Hi folks,
I wrote a guide on discrete-event simulation with SimPy, designed to give you a solid foundation in building simulations using Python. Kind of like the official documentation but on steroids.
I have used SimPy personally in my own career for over a decade, it was central in helping me build a pretty successful engineering career. My latest venture is teaching others all about it.
If you do get the guide, I’d really appreciate any feedback you have. Feel free to drop your thoughts here in the thread or DM me directly!
Here’s the link to get the guide: https://simulation.teachem.digital/free-simulation-in-python-guide
For full transparency, why do I ask for your email?
Well I’m working on a full course following on from my previous Udemy course on Python. This new course will be all about real-world modelling and simulation with SimPy, and I’d love to send you keep you in the loop via email. If you found the guide helpful you would might be interested in the course. That said, you’re completely free to hit “unsubscribe” after the guide arrives if you prefer.
/r/Python
https://redd.it/1gipp8a
What features are missing in Django?
1. What features are missing in Django?
2. Are you happy with the current state of Django?
/r/django
https://redd.it/1gijjyw
Python Institute Certs: Automation Track = Networking?
Hi there,
found that there is an automation certification track including the certs PCEA and PCAA at the Python Institute. Supposedly appearing in 2024.
https://pythoninstitute.org/certification-tracks
However, in the list that precedes the infographic, it is the python for networking track (certs PCEN and PCAN) that is mentioned next to the other tracks such as general programming etc.
Does anyone happen to know whether these are going to be the same certs/ merged?
In the sense of network automation? The different letters suggest they are different, but I’m confused why one appears in the list and the other one in the infographic.
/r/Python
https://redd.it/1gigwbg
Hello everyone I'm a beginner in django I took help of youtube to start my project of advance finance tracker but I'm lost as there are so many ways could you guys help me out
For my final year main project our group thought of doing django with data science but as I'm not a expert to be frank(I know only basics ) could you guys help me out 🙏 I'll be able to survive my last year
/r/django
https://redd.it/1gif0rw
How to implement RBAC using Flask-Restful?
Hello Everyone
I am a newbie. I am using flask for a SaaS product for my company. Earlier I was using flask and custom decorators for Role Based Access Control(RBAC). But during code review they asked to change the API end points to Flask-Restful. So I am confused about this.
Thank You in advance.
/r/flask
https://redd.it/1gi2la3
One thing about us developers is that we not business people so if you have experience working at a failed startup, what are some signs to look out for to see if you in a sinking ship?
As someone that has worked in a startup that did not do well. I think the signs were there when we client requests were inconsistent. We would serve a client there and there but there was no project that lasted a long time cause usually the service we provided would be complete in a month or 2. The company was funded to build a product so we can transition from providing a service to providing a Saas product but when the investors pulled out that's when it hit the fan that client work revenue was not enough to run a company and we were surviving off funding.
/r/django
https://redd.it/1ghzv3w
A filesystem navigator for the terminal
## What My Project Does
Terminal-tree is an experimental terminal-based filesystem navigator. You can explore your filesystem and preview files within the terminal.
Very early stage, I've been playing with the look and feel, but it could form the basis of a larger tool. Possibly a file manager, or file picker.
It is built with the Textual framework (which I also develop), and is a reasonably good example of a more complex widget which integrates blocking calls with an async framework.
The code is currently a single file:
https://github.com/willmcgugan/terminal-tree/blob/main/tree.py
More details on the repository:
https://github.com/willmcgugan/terminal-tree
## Target Audience
Anyone interested in building a terminal app. It is fun to play with (hopefully) but doesn't have any functionality on top of navigating and previewing files.
I'm open to suggestions on what could be built on top of this.
## Comparison
You could compare it to Ranger, Midnight Commander, or similar tools.
/r/Python
https://redd.it/1gi3tqo
HTML forms button input returns "None" value to flask
https://redd.it/1ghekk1
@pythondaily
pgmooncake: run python on your Postgres tables
**What it does**
[pg\mooncake](https://github.com/Mooncake-Labs/pgmooncake) brings a columnstore table to Postgres with DuckDb execution. These tables are written as Iceberg and Delta tables (parquet files + metadata) to your object store.
Query them outside of Postgres with DuckDB, Polars, Pandas, Spark directly without complex pipelines, stitching together ad-hoc files, or dataframe wangling.
**Target audience**
Product engineers, data engineers, data scientist.
**Comparison**
You can use psycopg2 / sqlalchemy today. But the approach here is fundamentally different. You're writing data to an s3 bucket. You can share that bucket to your data science, engineering, analyst team without giving them access to your Postgres.
There are some Parquet exporters in Postgres (pg\duckdb, pg_parquet, pg_analytics). pg_mooncake actually exposes table semantics inside of Postgres (updates, deletes, transactions). And table semantics outside of Postgres (Iceberg/Delta).
Story time!
I'm one of the founders of Mooncake Labs. We are building the simple lakehouse without the complex pipelines / data engineering infra.
Modern apps are built on Postgres. And we want to bring the python processing and analytics closer to this ecosystem.
Postgres and Python are all you need.
/r/Python
https://redd.it/1ghgmmq
I have finally released a new version for my package, Arrest 0.1.10
After many months of procrastination, I have finally managed to release version 0.1.10 of my package Arrest.
What it does
It is a package that lets you declaratively write a REST service client, configured with the sets of resources, routes and methods you want to call, and provide Pydantic models for request and responses to automatically parse them during the HTTP calls. Arrest also provides retry mechanisms, exception handling, automatic code generation from the OpenAPI specification, and much more.
Target audience
Primarily backend developers working on communicating with multiple web services from a Python client. It can also be useful in a microservice architecture where you have to write API bindings for all the dependant sevices for another service.
Comparison
There are packages that does similar things which I got to know about from this subreddit after my initial post. For example:
1. flask-muck by u/beef-runner
2. django-rest-client by u/16withScars
The key highlights of the new version are:
1. Support for arbitrary python types for request and response. These can be `list`, `dict`, `dataclass`, or `pydantic.BaseModel`, or anything that is JSON serializable.
2. Added custom hooks for handling different types of exceptions.
3. Revamped retry mechanism to make it more configurable and no implicit retries built-in
/r/Python
https://redd.it/1ghjt23
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
# Weekly Thread: Resource Request and Sharing 📚
Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!
## How it Works:
1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.
## Guidelines:
Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.
## Example Shares:
1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.
## Example Requests:
1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.
Share the knowledge, enrich the community. Happy learning! 🌟
/r/Python
https://redd.it/1ghjow6
Thank you r/Python - I'd like to give something back
Last month I asked this community if anyone would be willing to take my new course on how to code Python and give me some feedback in return.
The response was overwhelming and I am so grateful! Loads of people took the course and I got tonnes of feedback which I was able to implement. I'm really pleased to share that since then I have now had over 300 enrolments on the course and a small amount of income coming my way.
This is massive for me, since this was my first course and I am now going forward onto making more courses - this time on the topic of simulation in Python.
So as a thank you, I'd like to give away 100 complimentary vouchers for the course, just for this community: https://www.udemy.com/course/python-for-engineers-scientists-and-analysts/?couponCode=THANKSREDDIT
Please take one of the vouchers if you feel you might benefit from the course. It is aimed at people with some kind of existing technical skillset (e.g. engineers, scientists, etc) so has a focus on data, statistics and modelling. The main libraries covered are numpy, pandas and seaborn.
Thanks again r/Python
/r/Python
https://redd.it/1gh1svl
PyCon US 2025 Site Launches, CFP Live!
## PyCon US 2025
We're excited to announce that the PyCon US 2025 website and call for (talk) proposals are officially live!
Please help us spread the word, and if you're interested in giving a talk read the guidelines and submit one!
- Blog: <https://pycon.blogspot.com/2024/11/pycon-us-2025-launches.html>
- PyCon Website: https://us.pycon.org/2025
/r/Python
https://redd.it/1ghdnfr
Using Flask with Marshmallow
https://flask-india.hashnode.dev/using-flask-with-our-old-friend-marshmallow
/r/flask
https://redd.it/1gh5qi9
how to connect Dash app to MS SQL database ?
newbie question here, how to connect a dash application to ms sql database so that i can store "permannetly" data ?
Thanks
/r/flask
https://redd.it/1ggdxmr