Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Inviting contributions to an open source chat web app !

Hey everyone!

I’ve built a basic Django chat app using Django Channels & WebSockets, and I’d love to open it up for community contributions! The project is still in its early stages, and I believe it would be more exciting to build it together rather than alone.

I've opened multiple issues (friend requests, message indicators, PostgreSQL integration, etc.), so feel free to pick one, suggest improvements, or even add new features! It’s a great way to gain experience, build your portfolio, and collaborate with others.

Repo Link : https://github.com/frzn23/zeenchat

Would love to hear your thoughts and ideas!

/r/django
https://redd.it/1inwnz7
School Children NFC

Hi, I’m currently working on a school project to create a system for school children using NFC tags. The system is designed to handle attendance tracking and allow students to pay for food in the canteen using NFC. Parents can top up their children’s NFC tag balance through a web app that we’ve developed using Django and Python. I have limited knowledge about NFC, so if anyone has experience with a similar system, I would appreciate any advice or suggestions.


/r/Python
https://redd.it/1innetw
why there is no option like community edition jasper report whit report designer in python

Reportlab, fpdf and many other options are good but have no report designer which can be cumbersome to write small but many reports with header footer groups with visually aligned elements
Jasper reports is very good at it but there is no parallel in python

/r/Python
https://redd.it/1inkoli
Web Socket connection is failing between Flask and React, Docker Containers

I am trying to setup a dockerized development for ReactJS and Flask

1. My all other api are working correctly but the socket connection is failing.
2. When i sh into react container, and try to form socket connection with flask, it's working, but when using react app on localhost, the socket connection is failing.
3. CORs is allowed on the flask server
4. Accessing the flask server using docker service name
5. Everything (API + web sockets) seems to be working fine when running outside docker containers.
6. Tried to create a docker-network in the compose file as well
7. Tried disabling the Firewall on my MacBook as well

stacker link: https://stackoverflow.com/questions/79430474/web-socket-connection-is-failing-between-flask-and-react-docker-containers

/r/flask
https://redd.it/1in2ea7
I am creating a site that will need something similar to mods and subreddit. Should I create a mod called a super mod that can edit everything?

Hey I am sorry if this a dumb question and I am inexperienced.

Also a forum might be a better analogy.



I am building a simple admin features in flask for my app. But I have a question when designing the database. The analogy in my site is kind of like reddit mods and subreddit. I want to make is so only mods can create a new subreddit. Seems easy enough. Now my question, should I create a super mod that can edit everything? One of the negative is that if a super mod was hacked the entire site could go down. Or am I worrying about nothing? Also should I just make it so the first user is automatically a super mod and just add super mods and mods?

I am using flask sqlalchemy if that makes a difference also.

/r/flask
https://redd.it/1io33pt
Django 5.1 Security Vulnerabilities: What You Need to Know

# Executive Summary (For CEOs & Managers):

* **What’s at risk?** Attackers can exploit these vulnerabilities to disrupt services (denial-of-service) or compromise your database (SQL injection).
* **What should you do?** Instruct your technical team to upgrade Django to the latest secure versions immediately: **5.1.5, 5.0.11, or 4.2.18**, depending on what your systems use.
* **Why it matters:** Even a brief service disruption or successful SQL injection can lead to lost revenue, reputational damage, and compliance issues.

# Technical Breakdown (For Blue Teams & Developers):

# 1. CVE-2024-56374 – IPv6 Validation DoS

**Details:** Lack of a limit on string length when validating IPv6 addresses could allow attackers to overload the system, causing a denial-of-service.

* **Vulnerable Components:** `clean_ipv6_address`, `is_valid_ipv6_address`, and `django.forms.GenericIPAddressField` (Note: `django.db.models.GenericIPAddressField` is not affected).
* **Recommendation:** Upgrade to **5.1.5, 5.0.11, or 4.2.18**. Avoid using these functions in unpatched versions.

# 2. CVE-2024-53908 – SQL Injection in Oracle Databases

**Details:** Direct use of `django.db.models.fields.json.HasKey` lookup with untrusted data can lead to SQL injection attacks on Oracle databases.

* **Attack Vector:** SQL injection when the `HasKey` lookup is used with user-controlled input.
* **Recommendation:** Upgrade to **5.1.4, 5.0.10, or 4.2.17**. Review and sanitize any input passed to `HasKey` lookups.

# 3. CVE-2024-53907 – DoS in strip_tags() and striptags Filter

**Details:** The `strip_tags()` method and

/r/django
https://redd.it/1io0uhp
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

# Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.

---

## How it Works:

1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

---

## Guidelines:

- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.

---

## Example Topics:

1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?

---

Let's help each other grow in our careers and education. Happy discussing! 🌟

/r/Python
https://redd.it/1io5ruy
Problem with deployment in pythonanywhere

I'm trying to deploy my web application to pythonanywhere. The problem is that the really big one has many files and folders created following miguel's megatutorial. How can I put this folder containing the entire application in pythonanywhere?

/r/flask
https://redd.it/1im8ax6
Python pdf bytes stream to Postman

I acknowledge that the question might not be fully flask related.

Essentially I have a flask endpoint that takes a few arguments and stores a PDF File + an analytical object tied to it in MongoDB. One of the arguments passed to the endpoint is the pdf byte stream of the PDF itself.

I am trying now to test the endpoint via postman but I struggle to define to include the pdf byte stream as I can't seem to be able to copy the entire value of it from python. Has anyone else ever encountered a similar issue, i.e., manually defining a pdf byte stream as a parameter argument in postman?

Appreciate any help!

/r/flask
https://redd.it/1im845d
Segment anything UI: Segmentation / object detection annotation made the easy way

Hello to everyone.

I have officially released segment anything ui for segmentation / object detection annotation tasks. It is a PySide6 application.


I have been working on this tool for some time and I hope that it will help to remove annoying instance segmentation / object detection annotation. It is designed to be simple, feature rich and as automatic as possible. Feel free to request features, bugfixes or star the project.


https://github.com/branislavhesko/segment-anything-ui


Let's do the annotations the most pleasant way.

/r/Python
https://redd.it/1io2ohv
A polyphonic MIDI synth in less than 100 lines of code

# Background

I am posting a series of Python scripts that demonstrate using Supriya, a Python API for SuperCollider, in a dedicated subreddit. Supriya makes it possible to create synthesizers, sequencers, drum machines, and music, of course, using Python.

All demos are posted here: r/supriyapython.

The code for all demos can be found in this GitHub [repo](
https://github.com/dayunbao/supriyademos).

These demos assume knowledge of the Python programming language. They do not teach how to program in Python. Therefore, an intermediate level of experience with Python is required.

# The demo

In this demo, I show how to handle MIDI messages to play a polyphonic synthesizer using Supriya. It took a little less than 100 lines of code, which is pretty amazing.

/r/Python
https://redd.it/1ioh2jq
Starter Django Project (Boilerplate)

Hi all, I am looking for a starter Django project that only has the login, register, reset password, and activate account already set up (send email with activate/reset link). The setting up of the boilerplate is what always prevents me from starting new projects, sadly I am just so lazy.

If anyone knows of a repo that has this please can you point me to it. I will also help maintain it.

/r/django
https://redd.it/1iof4ow
Time to stop using filter()?

Python's built-in filter() function predates generators, and it has persisted, partly out of habit, partly for legacy reasons, and partly because it can be a bit faster than generators.

Having recently tested the performance of filters vs generators in Python 3.13, I found the speed benefit has reversed. In all of my tests, generators were faster than the equivalent filter call - typically by 5 to 10%.

Is it now time to stop using filter() in new code (Python >= 3.13), or are there still cases where it is clearly the better option?

/r/Python
https://redd.it/1iojoef
D How you do ML research from scratch?

Someone who has published their works at top ML conferences (NIPS, ICML, ICLR) or domain oriented conferences (CVPR, ICCV, ACL, EMNLP, KDD, SIGIR).
1. How do you get from 0 to your first paper?
2. How much is your skill (Pytorch, or domain knowledge)?
3. What is the whole process that you follow to become good at implementing your ideas?
4. How do you come up with an idea and solution?

/r/MachineLearning
https://redd.it/1ion90w
Turn Entire YouTube Playlists to Markdown Formatted and Refined Text Books (in any language)

Give it any YouTube playlist(entire courses for instance) and receive a clean, formatted and structured file with all the details of that playlist.

It's a simple yet effective script using the free Google Gemini API.

I haven't found any free tool available with this scale, so I made one.

This Python application extracts transcripts from YouTube playlists and refines them using the Google Gemini API(which is free). It takes a YouTube playlist URL as input, extracts transcripts for each video, and then uses Gemini to reformat and improve the readability of the combined transcript. The output is saved as a text file.

**What My Project Does**:

* Batch processing of entire playlists
* Refine transcripts using Google Gemini API for improved formatting and readability.
* User-friendly PyQt5 graphical interface.
* Selectable Gemini models.
* Output to markdown file.

**Target Audience**:

Turning large YouTube playlist into one large formatted text file has many advantages for studying and learning, documentation, having a source book of the playlist, etc...


**Comparison**:

I haven't found a similar tool that converts YouTube videos to easily readable document in this scale and be free and accessible.

Check it out : [https://github.com/Ebrizzzz/Youtube-playlist-to-formatted-text](https://github.com/Ebrizzzz/Youtube-playlist-to-formatted-text)

/r/Python
https://redd.it/1iou9nx
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
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
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
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