Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
For those who are good at cython, how did you learn it?
I found that cython docs is not the best and missing many information.
I also tried to search google but only found little results.
/r/Python
https://redd.it/1iqpkab
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/1iqf81z
Struggling to see the point of rotating JWT tokens.
I implemented rotating JWT tokens with SimpleJWT. But in my eyes there is a huge flaw with this, which somewhat makes me think is it really worth the hassle?
So the point of rotating JWT tokens from my understanding is that if a hacker compromises the crown jewel, your refresh token, then when you next refresh your tokens, this will invalidate both access and refresh, therefore your hacker can no longer use the refresh token anymore.
But what if a hacker decides to immediately refresh the token once he's stolen it? He will get 2 brand new tokens, access and refresh, and these tokens will never ever be a part of the victims history of tokens, as they never originated from the victim. So the victim tries to navigate to a protected route, only to be prompted to log in (due to the fact they are using the old refresh token which was stolen and invalidated). They log in again, and get a fresh pair of tokens themselves. Now you have the user and the hacker with two completely different refresh tokens, and neither effect the other. The hacker can continue refreshing his tokens, and will only be affecting his line of
/r/django
https://redd.it/1iqefgk
Django in government
https://thib.me/django-in-government
/r/django
https://redd.it/1iq9qkb
I published my third open-source python package to pypi
Hey everyone,
I published my 3rd pypi lib and it's open source. It's called stealthkit \- requests on steroids. Good for those who want to send http requests to websites that might not allow it through programming - like amazon, yahoo finance, stock exchanges, etc.
What My Project Does
User-Agent Rotation: Automatically rotates user agents from Chrome, Edge, and Safari across different OS platforms (Windows, MacOS, Linux).
Random Referer Selection: Simulates real browsing behavior by sending requests with randomized referers from search engines.
Cookie Handling: Fetches and stores cookies from specified URLs to maintain session persistence.
Proxy Support: Allows requests to be routed through a provided proxy.
Retry Logic: Retries failed requests up to three times before giving up.
RESTful Requests: Supports GET, POST, PUT, and DELETE methods with automatic proxy integration.
Why did I create it?
In 2020, I created a yahoo finance lib and it required me to tweak python's requests module heavily - like session, cookies, headers, etc.
In 2022, I worked on my django project which required it to fetch amazon product data; again I needed requests workaround.
This year, I created second pypi - amzpy. And I soon understood that all of my projects evolve around web scraping and data processing. So I
/r/Python
https://redd.it/1ipxhsk
Bookmarklets, defaults-from-GET, and iommi
https://kodare.net/2025/02/15/bookmarklets-default-from-GET.html
/r/django
https://redd.it/1ipz0ah
How to Create a User Registration Page in Django – Simple Guide
In this post, we’re setting up user registration in Django, creating forms, handling authentication, and using CSRF tokens to secure user input.
Blog Link: [How to Create a User Registration Page in Django](https://django-learning.hashnode.dev/how-to-create-a-user-registration-page-in-django)
In the last blog, we built Login & Logout functionality in Django.
Previous Blog Link: Add Login and Logout in Django – Simple Guide
Give it a read and let me know your thoughts in the comments! 💬 Your feedback helps me improve these guides! 😊
/r/django
https://redd.it/1ipz6w4
All-in-one DevKit ("Github in a box"). A robust dev kit you can run in docker to power up your coding workflows
Hey all, I'd gotten some requests from my colleagues and peers to make a tutorial on my local dev setup that I use, primarily for flask and such. I put together a youtube playlist that lines out my so-called "Github in a box" setup. It includes the following features:
* SCM
* Remote, sandboxed development environments
* CICD
* Dependency management
* Gists
* Static site hosting
* Static code analysis
* Pypi caching
* Docker registry caching
Essentially, what I use at home is a freebie version github where I self host it all to keep my data in-house. The main goal was to make it ultra portable and lightweight/flexible to my per-project needs. It's relatively easy to set up and use and very quick to spin up and tear down. Hope the community finds this useful.
Youtube playlist: [https://youtube.com/playlist?list=PLIS2XlWhBbX\_wz\_BsD-TYrZEUrUVCm1IO&si=OIs9ZorhUAPYle4U](https://youtube.com/playlist?list=PLIS2XlWhBbX_wz_BsD-TYrZEUrUVCm1IO&si=OIs9ZorhUAPYle4U)
Project files: [https://github.com/crono782/aio-devkit](https://github.com/crono782/aio-devkit)
/r/flask
https://redd.it/1iptmld
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/1ipornd
D We built GenAI at Google and Apple, then left to build an open source AI lab, to enable the open community to collaborate and build the next DeepSeek. Ask us anything on Friday, Feb 14 from 9am-12pm PT!
Proof: https://imgur.com/a/kxiTTXP
TL;DR: Hi 👋 we’re Oumi, an AI lab that believes in an unconditionally open source approach–code, weights, training data, infrastructure, and collaboration—so the entire community can collectively push AI forward. We built a platform for anyone to contribute research in AI. Ask us anything about open source, scaling large models, DeepSeek, and what it takes to build frontier models, both inside and outside of big tech companies. Tell us what is working well in open source AI or what challenges you are facing. What should we work on together to improve AI in the open?
\-------------
For years, we worked at big tech (Google, Apple, Microsoft) leading efforts on GenAI models like Google Cloud PaLM, Gemini, and Apple’s health foundation models. We were working in silos and knew there had to be a better way to develop these models openly and collaboratively. So, we built a truly open source AI platform that makes it possible for tens of thousands of AI researchers, scientists, and developers around the world to collaborate, working together to advance frontier AI in a collective way that leads to more efficient, transparent and responsible development. The Oumi platform (fully open-source, Apache 2.0 license) supports pre-training, tuning, data
/r/MachineLearning
https://redd.it/1ioxatq
memfile: Python library to store files in RAM
[memfile](https://github.com/LIZARD-OFFICIAL-77/memfile)
- **What My Project Does**
memfile wraps the built-in open() function for a new one, named memoryopen()
It is a fully drop-in replacement. It will work exactly like open() but the contents of the file will be in RAM and removed on reboot.
- **Target audience**
Probably embedded programming. The reason I made it is because of the project I'm working on where I need to use RAM instead of persistent storage as much as possible.
- **Comparison**
Well there is no alternatives that do specifically this.
IMPORTANT NOTICE: ONLY WORKS ON *Nix systems (Windows unsupported)
READ README BEFORE USE TO PREVENT MEMORY LEAKS / DANGLING SYMLINKS
/r/Python
https://redd.it/1ipei7z
DRF application boilerplate
I have a couple of new rest service required to be setup using DRF. This services will communicate with each other via REST and webhooks. I'm looking for some boilerplate like cookie cutter for DRF. My apps will use celery with production ready configuration and postgres as DB. since both apps will use postgres so I need some sort of docker and compose.yml which will start both apps with these dependencies after dockerfile is built.
Any suggestions for a boilerplate code for above requirements?
/r/django
https://redd.it/1ip8woh
MagicPrompt: Stupid simple (and powerful) CLI user interaction
# What My Project Does
MagicPrompt is a powerful one line solution for collecting CLI user input with absolutely zero boilerplate. No more writing input()
loops, or learning an overly complicated library. This abstracts looping, validations, terminal cleanup, type casting and formatting, while still allowing full control over any of these when needed.
https://github.com/austinmpask/pymagicprompt
Features:
Full lifecycle abstraction, by default looping until valid input
Automatic terminal cleanup for subsequent prompts/answers
Type inference & casting for answer submissions
Customizable boolean conversion for common English words
Built in common validators
Support for custom validation functions
Fully customizable prompt formatting & colors
Customizable answer sanitization & formatting
Obscured text for password inputs
Options can be specified by both kwargs and options
dict
# Target Audience
This can be used as a quality of life improvement to replace any CLI application currently using input()
# Comparison
Ordinarily when collecting user input in the terminal, one must wrap logic in loops and usually validate input. Most often, you will also have to eventually cast responses to a more sensible type than str. This abstracts all of that, leaving you just one line of code to write, while still retaining the ability to apply any customizations you need. There are similar packages for this,
/r/Python
https://redd.it/1ioscee
Friday Daily Thread: r/Python Meta and Free-Talk Fridays
# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️
Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!
## How it Works:
1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.
## Guidelines:
All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.
## Example Topics:
1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.
Let's keep the conversation going. Happy discussing! 🌟
/r/Python
https://redd.it/1ioxgi9
Need some guidance on creating a custom api endpoint for my Haystack search query
Hello guys, I'm trying to finish the \`apiview\` of my django-haystack search query. Right now I am using drf-haystack, instead of vanilla django-haystack, because I'm not using templates.
Rather I'm using VueJS as my frontend, so traditional django-haystack won't work in this case. I'm not seeing any errors and I haven't run automated tests yet for the search query api endpoint.
I'm also running my backend on Linux (Fedora) locally, that is I'm not using Docker or containers. I have some api calls in my frontend VueJS project including a search engine page that needs to communicate with this api endpoint, in particular the \`CompanySearch\` model instance. Please I need some advice for this. Let me know if there are specific files/further details you need from me. The Github repo for this project is set to private, otherwise I'd post the link here.
Anyway here are some important files that I will paste here:
[seriailizers.py](http://seriailizers.py)
\`\`\`
from rest_framework import serializers
from django.contrib.auth import authenticate
from .models import User, HomeownerUser
from .search_indexes import ArboristCompanyIndex, ServiceTypeIndex
from drf_haystack.serializers import HaystackSerializer
/r/djangolearning
https://redd.it/1io3v48
Drf vs Django ninja for new enterprise project?
Going to be working on a migration away from a legacy platform. I’ve decided on Django + react - but I’m not sure on the current landscape when it comes to Django ninja vs drf and which I should start the project with. Would love to hear thoughts or input on which to go with for a successful business moving away from a legacy php stack.
/r/django
https://redd.it/1iqnpgy
How bad does logging impact performance?
I run django channels in my application with heavy server-client communication and every message from a client triggers a log. Is that too bad?
/r/django
https://redd.it/1iq7703
D Is my company missing out by avoiding deep learning?
Disclaimer: obviously it does not make sense to use a neural network if a linear regression is enough.
I work at a company that strictly adheres to mathematical, explainable models. Their stance is that methods like Neural Networks or even Gradient Boosting Machines are too "black-box" and thus unreliable for decision-making. While I understand the importance of interpretability (especially in mission critical scenarios) I can't help but feel that this approach is overly restrictive.
I see a lot of research and industry adoption of these methods, which makes me wonder: are they really just black boxes, or is this an outdated view? Surely, with so many people working in this field, there must be ways to gain insights into these models and make them more trustworthy.
Am I also missing out on them, since I do not have work experience with such models?
EDIT: Context is formula one! However, races are a thing and support tools another. I too would avoid such models in anything strictly related to a race, unless completely necessary. I just feels that there's a bias that is context-independent here.
/r/MachineLearning
https://redd.it/1iq9gtk
D What's the most promising successor to the Transformer?
All I know about is MAMBA, which looks promising from an efficiency perspective (inference is linear instead of quadratic), but AFAIK nobody's trained a big model yet. There's also xLSTM and Aaren.
What do y'all think is the most promising alternative architecture to the transformer?
/r/MachineLearning
https://redd.it/1ipvau4
I'm unable to host my flask + index.html app in vercel, please guide me
the APIs are written as
@/app.route('/api/search', methods='POST')
and requests are sent as
const response = await fetch(endpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ query }),
});
I have vercel.json and file structure is correct, index.html is in templates, still unable to deploy, can anyone help me
/r/flask
https://redd.it/1ipzyz4
AttributeError raised on model unit tests
Hello everyone, quick question, below are my models
class MonthMixin(models.Model):
month = models.PositiveSmallIntegerField(
"month", validators=MinValueValidator(1), MaxValueValidator(12)
)
year = models.PositiveSmallIntegerField("year")
class Meta:
abstract = True
class Client(models.Model):
fullname = models.CharField("full name", maxlength=50)
def str(self):
return f"Client {self.pk}"
@property
def clientconsumptions(self) -> QuerySet[Consumption]:
return Consumption.objects.filter(client=self).orderby("year", "month")
def getconsumptionmonths(self, monthcount: int = 12) -> QuerySet[Consumption]:
"""Get queryset of the monthcount latest Comsumption
/r/djangolearning
https://redd.it/1ipertv
DjangoCongress JP 2025 Announcement and Live Streaming!
https://www.djangoproject.com/weblog/2025/feb/14/djangocongress-jp-2025-announcement-and-livestream/
/r/django
https://redd.it/1ipmi3r
Docullim: AI-Powered Python Documentation
Hey r/Python ! I just released docullim, a Python library that helps auto-generate documentation using LLMs—but with a twist. Instead of processing your entire codebase, docullim lets you selectively document functions and classes by adding a simple @docullim
annotation.
# What My Project Does
Add @`docullim` any function or class, and it generates documentation for just that part of your code.
Supports custom tags: @docullim
("custom_tag") lets you customise prompts.
Flexible CLI: Process individual files, directories, or even glob patterns like docullim "src/\*/*.py".
Outputs structured JSON so you can use it however you want.
Caches results locally to avoid redundant API calls and speed up future runs.
Works with custom models & configs: docullim --config docullim.json --model gpt-4 "src/\*/*.py"
It supports multiple different LLMs
# Target Audience
Developers & teams who want AI-generated documentation without bloating their entire repo.
Maintainers of large projects who need a structured, incremental approach to documentation.
Tooling enthusiasts looking for LLM-powered doc generation that integrates into their workflow.
# Comparison
Unlike other AI documentation tools, Docullim doesn’t generate docs for everything—it only runs where you tell it to. This makes it:
Faster (fewer API calls, less processing)
More controllable (no irrelevant or low-quality docstrings)
Easier
/r/Python
https://redd.it/1ipfgme
PostgreSQL & BeyondTrust Zero-Days Exploited in Coordinated Attacks
Relevant to Django Devs Using PostgreSQL:
Threat actors exploited a newly discovered PostgreSQL vulnerability (CVE-2025-1094) alongside a BeyondTrust zero-day (CVE-2024-12356), allowing them to achieve remote code execution. The PostgreSQL flaw enables attackers to execute arbitrary shell commands through SQL injection, significantly raising security risks for affected systems. (View Details on PwnHub)
/r/django
https://redd.it/1ipfnkf
Help with django
Ive started django recently
Im studying from Django for Beginners by WS vincent
Is it okay? or does anybody know sth better?
/r/djangolearning
https://redd.it/1ipb8i8
What are some components you build into your base flask application?
I am working on a template I can recycle for all my flask applications going forward to help speed up projects I am working on. So far what I have is user authentication and a "base" sql module that can do CRUD tasks on different tables of a database. The SQL module also handles connecting to the database engine in my docker stack.
This got me wondering what else, if at all, you all do anything similar?
/r/flask
https://redd.it/1ipfb5s
pyatomix, a tiny atomics library for Python 3.13t
* What My Project Does
it provides an AtomicInt and AtomicFlag class from std::atomic<int64_t> and std::atomic_flag, and exposes the same API. AtomicInt also overloads math operators so += for instance is an atomic increment.
https://github.com/0xDEADFED5/pyatomix
* Target Audience
Anyone who wants an easy to use atomic int or atomic flag. I don't see why it couldn't be used in production.
* Comparison
I was having trouble a while back finding a simple atomics library for Python 3.13t that either had wheels for Windows, or would build easily without fuss on Windows, so I made one. Wheels are available for the main platforms, but it builds easily on Windows and Linux. (C++ 20 required to build)
/r/Python
https://redd.it/1ip73nx
Python Developers: How Are You Finding Jobs in 2025?
Hey everyone,
I’ve been curious about the current job market for Python developers. With AI tools changing the landscape, how are you all finding work?
* Freelancing platforms Upwork and Fiverr still viable?
* How important is having a GitHub portfolio (personal projects)?
* What strategies have worked for landing clients or job offers?
I have already tried Fiverr and Upwork with no luck, so I’m looking for alternative ways to land work. Would love to hear your experiences, especially if you’ve recently landed a role or struggled in the process. Let’s help each other out!
/r/Python
https://redd.it/1ip3pvd
Making an ERP from scratch.
Hello.
How would you develop a mortgage loan business ERP? with the following conditions:
1. No experience or knowledge on programming or ERP development.
2. Your current ERP provider is shitty and ineffective. So you are done hiring someone else and want to learn to develop it yourself since depending on somebody else is frustrating.
Eager to listen your answers!
Javier.
/r/djangolearning
https://redd.it/1inwzc7
Announcing Django Shinobi, a fork of Django Ninja
For those who have been following or been involved with recent development of Django Ninja, you’ll notice that for a little over a year, almost all development has come to a halt. About 60 PRs have built up on the GitHub repository, many of which fix crucial issues, but are not getting any feedback and have no path forward to getting them merged. PRs that fix documentation will get merged in a day, but most PRs that touch code are left out to dry. Among these PRs include performance improvements, the validation vs. serialization split, my own fix for aliases, and much more. It's getting desperate enough that people are posting monkeypatches in the PRs.
I have spoken with Ninja's maintainer a bit about the issue and I think it's mostly just a split in priorities between him and myself. That's totally reasonable and respectable, its his project. But as a user of the library, I can't really say that I feel supported by this direction, and I would assume from the many repeated requests for review from the PR submitters that most in the community aren’t too happy either. Most of these existing issues aren’t complete showstoppers, but they are
/r/django
https://redd.it/1ion5cz