pythondaily | Education

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Subscribe to a channel

Python Daily

python-injection – A lightweight DI library for async/sync Python projects

Hey everyone

Just wanted to share a small project I've been working on: `python-injection`, an open-source package for managing dependency injection in Python.

## What My Project Does

The main goal of python-injection is to provide a simple, lightweight, and non-intrusive dependency injection system that works in both sync and async environments.
It supports multiple dependency lifetimes: transient, singleton, and scoped.
It also allows switching between different sets of dependencies at runtime, based on execution profiles (e.g., dev/test/prod).
The package is primarily based on the use of decorators and type annotation inspection, with the aim of keeping things simple and easy to adopt without locking you into a framework or deeply modifying your code.
It can easily be used with FastAPI.

## Target Audience

This is still an early-stage project, so I avoid breaking changes in the package API as much as possible, but it's still too early to say whether it's usable in production.
That said, if you enjoy organizing your code using classes and interfaces, or if you're looking for a lightweight way to experiment with DI in your Python projects, it might be worth checking out.

## Comparison

I’ve looked into several existing Python DI libraries, but I often found them either too heavy

/r/Python
https://redd.it/1k0gy9r

Читать полностью…

Python Daily

5 Things You Wish You Knew Before Starting Django



https://preview.redd.it/lmb92qul68ve1.png?width=1280&format=png&auto=webp&s=ccaeeb6b1e2419a9c50744b0d5ad0930da71edc7

After 5 years as a backend developer, here's what I really wish someone told me when I started learning Django 👇

1️⃣ Django is NOT just the Admin panel
Many people think Django is only for quick CRUD apps because of its admin interface. But the real power lies in custom apps, APIs, signals, middleware, and reusable architecture.

2️⃣ Class-Based Views (CBVs) are powerful—but confusing at first
CBVs feel overwhelming initially, but once you master ListView, DetailView, and mixins, they save tons of code.

3️⃣ Use Django REST Framework (DRF) early
If you're building APIs, DRF is your best friend. Master Serializers, ViewSets, and Routers early. It’ll make you a 10x backend dev.

4️⃣ Project structure matters
Splitting apps properly, separating services, utils, and permissions, and planning for scale early saves massive refactoring pain later.

5️⃣ Signals and Middleware are game-changers
Want to trigger actions automatically or customize request/response flow? Learn signals and middleware to level up.

💡 Bonus Tip: Learn Django the right way. Don’t just follow CRUD tutorials—build real-world systems (accounting, HR, booking, dashboards, etc.)

🔥 I’m building a full real-world Django backend course (no repetitive clones, pure architecture + business logic).
Follow me if you're interested 💬

\#django #python

/r/django
https://redd.it/1k0oyxr

Читать полностью…

Python Daily

I need help understanding CRUD best practices

Hi All 👋

I'd like some help understanding best practices for handling CRUD calls for DB Association Tables. To help explain, I'll share a boiled down version of my DB Table relationship (see screenshot of dbdiagram below).

I'm using Flask-SQLAlchemy.

It feels like I'm missing something, do I need to manually write unique Create, Read, Update, Delete commit helper_functions for a Table that has Relationships? For example:

If I want to create a new 'DriverEvent' I have a module called db_commit_helpers with functions that contain logic to check if related Table items exist or not:

def adddriverEvent(dbsession, drivername: str, eventname: str, eventdate: datetime.date):
    driver = db
session.query(Driver).filterby(drivername=drivername).first()
    event = db
session.query(Event).filterby(eventname=eventname, eventdate=eventdate).first()

    if driver is None:
        driver = add
driver(dbsession, drivername)

    if event is None:
        raise ValueError(f"Event with name: '{eventname}' and date: '{eventdate}' does not exist! Please add the event first.")
   
    if driver and event:
     

/r/flask
https://redd.it/1jzh8x9

Читать полностью…

Python Daily

What stack or architecture would you recommend for multi-threaded/message queue batch tasks?

Hi everyone,
I'm coming from the Java world, where we have a legacy Spring Boot batch process that handles millions of users.

We're considering migrating it to Python. Here's what the current system does:

Connects to a database (it supports all major databases).
Each batch service (on a separate server) fetches a queue of 100–1000 users at a time.
Each service has a thread pool, and every item from the queue is processed by a separate thread (pop → thread).
After processing, it pushes messages to RabbitMQ or Kafka.

What stack or architecture would you suggest for handling something like this in Python?

UPDATE :
I forgot to mention that I have a good reason for switching to Python after many discussions.
I know Python can be problematic for CPU-bound multithreading, but there are solutions such as using multiprocessing.
Anyway, I know it's not easy, which is why I'm asking.
Please suggest solutions within the Python ecosystem

/r/Python
https://redd.it/1k0f9v6

Читать полностью…

Python Daily

D Google just released a new generation of TPUs. Who actually uses TPUs in production?

Google recently their new generation of TPUs optimized for inference: https://blog.google/products/google-cloud/ironwood-tpu-age-of-inference/

Google TPUs have been around for quite some time now, and I've rarely seen any company seriously use them in production...

At NLP Cloud we used TPUs at some point behind our training and fine-tuning platform. But they were tricky to set up and not necessarily faster than NVIDIA GPUs.

We also worked on a POC for TPU-based inference, but it was a failure because GCP lacked many must-have features on their TPU platform: no fixed IP address, no serious observability tools, slow TPU instance provisioning process, XLA being sometimes hard to debug...

Researchers may be interested in TPUs but is it because of TPUs themselves or because of the generous Google TRC program ( https://sites.research.google/trc ) that gives access to a bunch of free TPUs?

Also, the fact that Google TPUs cannot be purchased but only rented through the GCP platform might scare many organizations trying to avoid vendor lock-in.

Maybe this new generation of TPUs is different and GCP has matured the TPU ecosystem on GCP?

If some of you have experience using TPUs in production, I'd love to hear your story 🙂

/r/MachineLearning
https://redd.it/1k0fg57

Читать полностью…

Python Daily

The Ultimate Roadmap to Learn Software Testing – for Developers 🧪

Hey folks 👋

I’ve put together a detailed **developer-focused roadmap** to learn software testing — from the basics to advanced techniques, with tools and patterns across multiple languages like .NET, JavaScript, Python, and PHP.

# Why I built it:

* I struggled to find a roadmap that’s **structured**, yet practical.
* Wanted something that covers **testing types**, **naming standards**, **design patterns**, **TDD/BDD**, **tooling**, and even **test smells**.
* Also added a section for **static code analysis**, **test data generation**, and **performance testing tools**.

It’s designed to:

* Be a **self-assessment guide** 🧠
* Offer **starter resources** for beginners
* Give seniors a **checklist** to see what they're missing

💡 You can view everything in one glance with the included visual roadmap.

# ✅ Want to help?

If you find this useful, I’d love:

* Feedback or suggestions
* Ideas for additional tools/sections
* Contributions via PR or Issues

Here’s the repo: [\[GitHub link\]](https://github.com/hasanxdev/Test-Roadmap-For-Developers)

If you like it, please ⭐ the repo – helps others find it too.

Let’s make testing less scary and more structured 💪
Happy coding!

/r/Python
https://redd.it/1k0da93

Читать полностью…

Python Daily

Am I crazy for running my Django app on a Raspberry Pi?

Hey!

I'm doing something fun: setting up a complete Django website on my Raspberry Pi. So far I've got Django with PostgreSQL, MinIO instead of AWS for file storage, and Nginx with Let's Encrypt certificates.

Basically, I want to have my own "home cloud" that works independently. This is purely experimental and to save some cash (Heroku ain't cheap these days!).

I'm wondering if using a Raspberry Pi like this is a bad idea. Can it work for small projects or prototypes? What should I watch out for like overheating, SD card wear, or other issues?

I just want to learn and have something working without spending money on external servers. Has anyone else done something similar?

/r/django
https://redd.it/1k0azhh

Читать полностью…

Python Daily

Is someone looking for a side project?

Hi all,

As you can guess from the title, I'm looking to connect with someone who is looking for a side project.

The context is, I started a cybersecurity/privacy startup some time ago around data leaks on websites. Still pre-revenue. At that time, I was by myself and decided to go with tools that I was comfortable with (flask)...

Now, more teammates are in and interest from customers is growing... So keeping the flask API does not seem sustainable in the mid-long term anymore.

I posted some time ago a question to see if Django was the right way to go, and after jumping into the documentation and doing some courses it definitely feels like it's ideal.

With these changes and demand for more business effort from my side, I'm struggling to find more time to spend on doing technical stuff (which breaks my heart...) and I wonder if any of you would like to get to talk and see if we click and can do something together.

Thanks for reading!
I'll reply to your comment if you're interested, feel free to DM!

/r/django
https://redd.it/1k020y1

Читать полностью…

Python Daily

I made a YouTube video creator with Python (moviePy, requests, Pandas, and more)

Just wanted to share a quick post about a Python project I made with my daughter. We love movies and also movie quizzes on YouTube, but I wasn't happy with the existing content on YouTube. I felt like the movies were too repetitive on some quizzes and also didn't have enough variety. I wanted something that could have art house films to blockbusters and everything in between.



I created a Python app that loads in a list of all movies (within reason) and then selects some number of them for that quiz usually by theme (like easy movies of the 2010s). The app then goes out and gets screenshots from all the selected movies and allows you to select one of them for each movie for the quiz. After picking all your movies, it stitches everything together with MoviePy.



It was a really fun project and another great example of what you can do in Python. Thanks to this community for helping inspire projects like these.



Here's our latest video if you want to see the end results:

Latest Video

/r/Python
https://redd.it/1k00ixd

Читать полностью…

Python Daily

PLAYTESTERS WANTED: A game that secretly teaches you Python

Hello, everyone!

I am a first-time solo game developer working on a browser game that secretly teaches you Python.

It's an escape room meets an adventure game meets CTF meets puzzle chaos, where solving problems with code is the key mechanic. You start with zero knowledge, and before you know it, you're writing real-life code like a wizard with a keyboard. No theory dumps, no boring walls of text or long explanations - just you in an interactive world filled with puzzles where coding is the core part of the gameplay loop and affects your surroundings. You learn coding by playing, just as you learn any other game's mechanics.

I've successfully tested an early prototype with some friends (both coders and not), and I am currently finishing a demo/vertical slice. I am looking for people who would like to participate in my user research and/or in the upcoming playtests. If this sounds interesting to you, please sign up here: https://forms.fillout.com/t/26tNSjx29Bus

I am curious which learning paths people have tried before, so any input would be highly appreciated! If anyone else is also interested in this, I am happy to share the survey results here later, too.

/r/Python
https://redd.it/1jzrb38

Читать полностью…

Python Daily

Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

/r/Python
https://redd.it/1jzdwrh

Читать полностью…

Python Daily

Sending Auth token to the backend using http:

I am using next.js server,

I am sending Authorization from frontend to nextjs server, and from there I am calling Backend server with http:// , but I am getting acess-token not present header, it works if use https:// to call Backend server from the nextjs server.

on console headers before fetch call I can see Authorization token present but it is not sent to the Backend server.

/r/flask
https://redd.it/1jzjdvw

Читать полностью…

Python Daily

Django Dev for Hire – 6+ yrs experience (REST APIs, SaaS, full-stack with Svelte frontend)

Hey Django folks,

I’m a Django developer with over 6 years of experience, available for freelance projects or consulting. I have deep experience with the Django ecosystem (including Django REST Framework) and have used it to build some pretty complex applications. My biggest project to date was developing an entire SaaS application (an ed-tech platform called Birdverse) where Django + DRF powered the backend for everything (and I paired it with a SvelteKit frontend).

# What I offer:

• Expert-level Django skills: building models, views & viewsets, forms, templates, and REST API endpoints (DRF). Comfortable with Django authentication, admin customizations, Celery for background tasks, and other common add-ons.

• Problem solving: I can help debug tricky Django issues, improve query performance (ORM optimization), or refactor legacy Django code for better maintainability.

• Full-stack capability: While Django is my specialty, I’m also proficient on the frontend side (if needed) with Svelte/TS and CSS. I can integrate a modern front-end seamlessly with your Django backend. (If your project is Django-only — e.g. server-rendered pages or an API for a mobile app — that’s perfectly fine too.)

• Experience deploying Django apps (Gunicorn/Uvicorn, Nginx, Docker, DO setups) and handling the DevOps side of things for a smooth production rollout using VS code with

/r/django
https://redd.it/1jzfubr

Читать полностью…

Python Daily

Trouble Getting PayPal Receipts/Invoices in Django Using Sandbox Accounts

Hi everyone,

I'm currently working on a Django project that integrates PayPal for processing payments, and I'm running into an issue with generating receipts or invoices. I’m using PayPal sandbox accounts for testing, and the problem is that users don’t seem to receive any receipt or invoice after completing a payment even though they get a email notification that their hypothetical subscription has gone through and their account has updated?

Here’s what I’ve done so far:

Django Integration: I have set up my views and endpoints to handle PayPal payment notifications and callbacks, and everything seems to be running without errors.

Sandbox Testing: I’m testing using PayPal’s sandbox environment, but despite successful payments, no receipt/invoice is triggered to the user.

My Questions:

1. Is it possible that this behavior is due to a configuration setting in my PayPal sandbox account, rather than an issue with my Django code?
2. Are there any specific settings or API options I need to enable in my PayPal account (sandbox) to trigger the automatic sending of receipts/invoices?
3. Has anyone else experienced this issue or have advice on how to troubleshoot it further?



/r/django
https://redd.it/1jz475g

Читать полностью…

Python Daily

Hosting for django

I made e commerce website for my client, now want to hosting that in cheap and best plan in railway or digital Ocean, can anyone recommend me

/r/django
https://redd.it/1jyr4f6

Читать полностью…

Python Daily

Could use some help with a project.

Hello folks,

I recently offered to help build my mom some software which she could use for her small import/export company that could help her manage various projects over their lifetime, clients and suppliers, track payments, etc. Basically a typical CRM tool, with a project management and accounting tool wrapped in that could generate some invoices and help her keep track of everything and help her company start to scale.

Since I am still a student, I thought this would be a good learning experience for me, but I think that I might have gone a bit over my head. Since I actually like my mom, I want to provide her with a system that is both functional and useable, so I would like to defer to someone a bit more knowledgable and experienced to help me build a prototype.

I am basically wanting to take some of the project management and client tracking features from Django-CRM and merge it with the accounting system from Django-Ledger. I think it would take maybe a week or two from someone unexperienced, and a couple of days from someone who knows what they are doing.

I don't have much money currently since I am a student,

/r/django
https://redd.it/1k0qr3s

Читать полностью…

Python Daily

DF Embedder - A high-performance library for embedding dataframes into local vector db

I've been working on a personal project called DF Embedder that I wanted to share in order to get some feedback.

What My Project Does

It's a Python library (with a Rust backend) that lets you embed, index, and transform your dataframes into vector stores (based on Lance) in a few lines of code and at blazing speed. Once you have relevant data in a pandas or polars dataframe you can turn this into a low latency vector store.

Its main purpose was to save dev time and enable developers to quickly transform dataframes (and tabular data more generally) into working vector db in order to experiment with RAG and building agents, though it's very capable in terms of speed.

# read a dataset using polars or pandas
df = pl.readcsv("tmdb.csv")
# turn into an arrow dataset
arrow
table = df.toarrow()
embedder = DfEmbedder(database
name="tmdbdb")
# embed and index the dataframe to a lance table
embedder.index
table(arrowtable, tablename="filmstable")
# run similarities queries
similar
movies = embedder.findsimilar("adventures jungle animals", "filmstable", 10)

Target Audience

Developers working on AI/ML projects that involve RAG / vector

/r/Python
https://redd.it/1k0mpke

Читать полностью…

Python Daily

Learning Python & Django Framework

I'm planning to learn Python and the Django framework for implementing REST APIs. Where did you learn, or what resources did you use? I'm coming from a Laravel background.

/r/django
https://redd.it/1k0aksx

Читать полностью…

Python Daily

Lung Cancer Detection - Flask API

Hello again guys, I build this machine learning project pipeline for analysis and to detect a lung cancer, based from symptoms, smoking habits, age & gender with low cost only. The model accuracy was 93% using gradient boosting, and Integrated it in flask api:)



Small benefits: Healthcare assistant, Decision making, Health awerness

You can try: https://lungcancerml.pythonanywhere.com/api/v1/predict

Source: https://github.com/nordszamora/lung-cancer-detection.git


Note: Always seek for real professional regarding about in health.

I need your feedback and suggestions.

/r/flask
https://redd.it/1jz3ufq

Читать полностью…

Python Daily

Deployment of django in Windows cloud server

Hi guys, newbie here, started web dev journey to build a simple CRM software for our business. We do online retail selling mostly automotive parts. Recently we decided to develop our own internal dashboard that we can use for ourself. I took the task as I was already working here as technician and learning more stuff couldn’t hurt.

Anyway, I have developed the application using django + react. Communication between both using Axios. Now in term of deployment, from what I understand from googling a lot, I have to deploy both of them in 2 separate containers?

And I can deploy django using IIS in windows server. But I’ve been trying to figure out this since last week and I am still not going anywhere with it.

I hope someone can shed a light on what is your recommendation to deploy my application online. What should I do, step that I should take, direction, etc.

Thanks for the help.

/r/djangolearning
https://redd.it/1jzl21d

Читать полностью…

Python Daily

Python in SAS out

The powers that be have decide everything I’ve been doing with SAS is to be replaced with Python. So being none too happy about it my future is with Python.

How difficult is it to go from an old VBA in Excel and Access geek to 12 yrs of SAS EG but using the programming instead of the query builder for past 8 to now I’ve got to get my act over into Python in a couple of or 6 months?

There is little to no actual analysis being done. 90% is taking .csv or .txt data files and bringing them in linking to existing datasets and then merging them into a pipe text for using in a different software for reports.

Nothing like change.

/r/Python
https://redd.it/1k02ryl

Читать полностью…

Python Daily

Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

/r/Python
https://redd.it/1k06xer

Читать полностью…

Python Daily

Hatchet - a task queue for modern Python apps

Hey r/Python,

I'm Matt - I've been working on Hatchet, which is an open-source task queue with Python support. I've been using Python in different capacities for almost ten years now, and have been a strong proponent of Python giants like Celery and FastAPI, which I've enjoyed working with professionally over the past few years.

I wanted to share an introduction to Hatchet's Python features to introduce the community to Hatchet, and explain a little bit about how we're building off of the foundation of Celery and similar tools.

## What My Project Does

Hatchet is a platform for running background tasks, similar to Celery and RQ. We're striving to provide all of the features that you're familiar with, but built around modern Python features and with improved support for observability, chaining tasks together, and durable execution.

## Modern Python Features

Modern Python applications often make heavy use of (relatively) new features and tooling that have emerged in Python over the past decade or so. Two of the most widespread are:

1. The proliferation of type hints, adoption of type checkers like Mypy and Pyright, and growth in popularity of tools like Pydantic and attrs that lean on them.
2. The adoption of async / await.

These two sets

/r/Python
https://redd.it/1k045yv

Читать полностью…

Python Daily

Matching names & addresses techniques recommendations

Context:
I have a dataset of company owned products like: Name: Company A, Address: 5th avenue, Product: A.
Company A inc, Address: New york, Product B.
Company A inc. , Address, 5th avenue New York, product C.

I have 400 million entries like these. As you can see, addresses and names are in inconsistent formats.
I have another dataset that will be me ground truth for companies. It has a clean name for the company along with it’s parsed address.

The objective is to match the records from the table with inconsistent formats to the ground truth, so that each product is linked to a clean company.



Questions and help:
- i was thinking to use google geocoding api to parse the addresses and get geocoding. Then use the geocoding to perform distance search between my my addresses and ground truth BUT i don’t have the geocoding in the ground truth dataset. So, i would like to find another method to match parsed addresses without using geocoding.

- Ideally, i would like to be able to input my parsed address and the name (maybe along with some other features like industry of activity) and get returned the top matching candidates

/r/Python
https://redd.it/1jzockh

Читать полностью…

Python Daily

Python job market analytics for developers / technology popularity

Hey everyone!

Python developer job market analytics and tech trends from LinkedIn (compare with other programming languages):

Worldwide:

[Python](https://www.linkedin.com/jobs/search?keywords=%22python%22%20NOT%20%28%22qa%22%20OR%20%22ml%22%20OR%20%22scientist%22%29&location=worldwide&geoId=&trk=public_jobs_jobs-search-bar_search-submit&position=1&pageNum=0): 242000.
Java: 180000.
[C#/.NET](https://www.linkedin.com/jobs/search?keywords=%28%22c%23%22%20OR%20Dotnet%20OR%20%22.net%22%20OR%20%28%22net%20Developer%22%20OR%20%22net%20Backend%22%20OR%20%22net%20Engineer%22%20OR%20%22net%20Software%22%29%29%20NOT%20%22qa%22&location=Worldwide&geoId=&trk=public_jobs_jobs-search-bar_search-submit&position=1&pageNum=0): 110000.
Go: 81000.

USA:

Python: 63000.
Java: 33000.
C#/.NET: 29000.
Go: 31000.

Brasil:

Python: 6000.
Java: 2000.
C#/.NET: 1000.
Go: 1000.

United Kingdom:

Python: 9000.
Java: 3000.
C#/.NET: 4000.
Go: 5000.

France:

Python: 9000.
Java: 5000.
C#/.NET: 2000.
Go: 1000.

Germany:

Python: 10000.
Java: 8000.
C#/.NET: 6000.
Go: 2000.

India:

Python: 31000.
Java: 28000.
C#/.NET: 13000.
Go: 9000.

China:

Python: 29000.
Java: 29000.
C#/.NET: 9000.
Go: 2000.

Japan:

Python: 4000.
Java: 3000.
C#/.NET: 2000.
Go: 1000.

Search query:

Python: "python" NOT ("qa" OR "ml" OR "scientist")
Java: "java" NOT ("qa" OR "analyst")
C#/.NET: ("c#" OR Dotnet OR ".net" OR ("net Developer" OR "net Backend" OR "net Engineer" OR "net Software")) NOT "qa"
Go: "golang" OR ("go Developer" OR "go Backend" OR "go Engineer" OR "go Software") NOT "qa"

/r/Python
https://redd.it/1jzphbe

Читать полностью…

Python Daily

Deployed my first Flask app :)

It's not much but feels satisfying to have something running live. Check it out if you want bookguessr.com

I used plain css, htmx and jQuery UI for the book search autocomplete. Hosting both Postgres db and webapp on Render. I have no real experience with other tech stacks or hosting providers but the experience has been surprisingly smooth.


The book texts are generated by ChatGPT/Grok through their respective APIs. Some improvements can be done here for sure :D

/r/flask
https://redd.it/1jz6mof

Читать полностью…

Python Daily

🌷 Pygame Community Spring Jam 2025 🌸

/r/Python
https://redd.it/1jzevu4

Читать полностью…

Python Daily

Unwanted data caching

I am devving a home project. If I add a new item that should appear in a drop down menu on next pages, it will not appear unless I restart the dev server.

For example, if I select add new on the location drop down in the Quickadds view, htmx will redirect me to a new page where I can write a new location. If I go back to the previous page, the new location is not available until I restart the server. I then simply refresh the page and the extra item is there in the drop down.

I am set up with postgres in the cloud but running in WSL2.

This is my forms:

````
from django import forms
from django.urls import reverse_lazy
from app import models
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Field, HTML
from bootstrap_datepicker_plus.widgets import DatePickerInput

class QuickAdd(forms.Form):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = FormHelper(self)
self.helper.form_action = reverse_lazy('quickadded')
self.helper.form_method = 'POST'
self.helper.add_input(Submit('submit','Add'))

item = forms.CharField()
location =

/r/django
https://redd.it/1jze5ji

Читать полностью…

Python Daily

An issue in backwards function of Django migration when trying to convert DateTimeField back to a BooleanField in

I have a model with a field named viewed , which was initially a Boolean field. I wrote a migration to change it to a DateTimeField and set its value to the updated field timestamp if its current value is True.

This is my model

class Project(TimestampedModel):
title = models.CharField(maxlength=255)
url = models.URLField(unique=True, max
length=1000)
description = models.TextField(default="")
viewed = models.DateTimeField(null=True) # <- it was a BooleanField
publishedat = models.DateTimeField(null=True, blank=True)

class Meta:
ordering = ["-viewed"]

Here's my migration file:

# Generated by Django 5.1.5 on 2025-04-14 16:49
from django.db import migrations, models

def alter
viewedfieldvalue(apps, schemaeditor):
Project = apps.get
model('core', 'Project')
for project in Project.objects.filter(viewed=True):
project.viewed = project.updated


/r/django
https://redd.it/1jz4ngn

Читать полностью…

Python Daily

Open Source projects open for contribution for beginners

Hello, I'm looking for python open source projects that are looking for contributions. I don't have many contributions to public projects, but I'd like to have more. If you know any project that is looking for help, don't hesitate to put them here! Specially projects that are beginner friendly.

/r/Python
https://redd.it/1jz015y

Читать полностью…
Subscribe to a channel