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
Start project with wagtail? or integrate wagtail into existing django app?

I'm transitioning from the JavaScript world and planning a new app with Django. I need admin users to frequently insert content using a CMS like Wagtail. The app will include several marketing pages, an e-commerce checkout, and a delivery system for digital content. What’s the best way to structure this with Wagtail?

/r/django
https://redd.it/1ierzj2
Running a Python flask app 24/7 on a cloud server

I have a Python flask web application that takes the data from a shopify webhook and appends rows to Google sheet. Since it is a webhook, I want it to be running 24/7 as customers can place orders round the clock. I have tested it on my local machine and the code works fine but since then, I have tested it on Render, Railway.app and Pythonanywhere and none of those servers are working with the webhook data or are running 24/7. How can I run the app 24/7 on a cloud server?

The code runs fine on Railway.app and Render and authenticates the OAuth but when the webhooks is tested, it does not generate any response and moreover the app stops running after a while.

I tested the same app on my local machine using ngrok and every time a new order is placed, it does generate the expected results (adds rows to Google sheet).

/r/flask
https://redd.it/1iev22o
Tutorials with good frontend

What are some good Flask tutorials that actually have good frontend UI?
I'm wanting to follow along with a tutorial that gets more in depth into an actual real use case instead of just a simple form

/r/flask
https://redd.it/1ie1kw4
My First Python code on NFL Data Visualization

I’m excited to share with you my first Python code: **Football Tracking Data Visualization**. As someone passionate about both programming and sports—especially the NFL—this project has allowed me to combine these interests and dive into real-time data analysis and visualization.

# 🔍 What is the project about?

This repository uses football player tracking data, collected through the NFL Big Data Bowl, to create interactive visualizations. The project allows us to see player movements during plays, interpret stats, and observe player interactions on the field. 🎯

# 🛠 What technologies and tools did I use?

* **Python**: The core of the project, used for data processing and creating visualizations.
* **Pandas and NumPy**: For data manipulation and analysis.
* **Matplotlib and Seaborn**: For creating detailed plots.
* **Plotly**: For interactive visualizations.
* **Jupyter Notebooks**: As the development environment.

# 📊 What can you find in this repository?

1. **Play visualizations on the field**: Watch players move on the field in real-time!
2. **Interactive statistics**: Analysis of plays and key player stats.
3. **Team performance**: Insight into team strategies based on the data from each game.

# [https://github.com/Sir-Winlix/Football-Tracking-Visualization](https://github.com/Sir-Winlix/Football-Tracking-Visualization)

/r/Python
https://redd.it/1ieq2sn
D Monthly Who's Hiring and Who wants to be Hired?

For Job Postings please use this template

>Hiring: [Location\], Salary:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] and [Brief overview, what you're looking for\]

For Those looking for jobs please use this template

>Want to be Hired: [Location\], Salary Expectation:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] Resume: [Link to resume\] and [Brief overview, what you're looking for\]

​

Please remember that this community is geared towards those with experience.

/r/MachineLearning
https://redd.it/1ie5qoh
Introducing Kreuzberg: A Simple, Modern Library for PDF and Document Text Extraction in Python

Hey folks! I recently created Kreuzberg, a Python library that makes text extraction from PDFs and other documents simple and hassle-free.

I built this while working on a RAG system and found that existing solutions either required expensive API calls were overly complex for my text extraction needs, or involved large docker images and complex deployments.

Key Features:

- Modern Python with async support and type hints
- Extract text from PDFs (both searchable and scanned), images, and office documents
- Local processing - no API calls needed
- Lightweight - no GPU requirements
- Extensive error handling for easy debugging

## Target Audience:
This library is perfect for developers working on RAG systems, document processing pipelines, or anyone needing reliable text extraction without the complexity of commercial APIs. It's designed to be simple to use while handling a wide range of document formats.

```python
from kreuzberg import extract_bytes, extract_file

# Extract text from a PDF file
async def extract_pdf():
result = await extract_file("document.pdf")
print(f"Extracted text: {result.content}")
print(f"Output mime type: {result.mime_type}")

# Extract text from an image
async def extract_image():
result = await extract_file("scan.png")
print(f"Extracted text: {result.content}")

# Or extract from a byte string

# Extract text from PDF

/r/Python
https://redd.it/1if3axy
Add Login and Logout in Django

In this post, we’re setting up Login & Logout functionality, building forms, and using Django authentication & CSRF tokens.

Blog Link : [Add Login and Logout in Django – Simple Guide](https://django-learning.hashnode.dev/add-login-and-logout-in-django-simple-guide)

In the last blog, we built a Django template.

Previous Blog Link : Django Templates Explained: A Guide to Dynamic Web Pages

Give it a read and let me know your thoughts in the comments! 💬 Your feedback helps me make these guides even better! 😊

/r/django
https://redd.it/1if2uam
Suggest me free Flask course or tutorial

I've learned Python fundamentals and frontend. Now I want to start learning Flask for backend.
I've tried Miguel Grinberg's course. But I failed to understand.

Can you guys suggest me some other good Flask courses or tutorials that start from beginner topics and cover advanced topics?

/r/flask
https://redd.it/1if5x86
Automation Framework for Python

What My Project Does

Basically I was making a lot of automations for my clients and developed a toolset that i am using for most of my automation projects.
It is on Python + Playwright (for ui browser automation) + requests (covered with base modules for API automation) + DB module. I believe it maybe useful for someone of you, and I’ll appreciate your stars/comments/pull-requests:

https://github.com/eshut/Inject-Framework

I understand it may be very «specialized» thing for someone, but if you need to automate something like website or api - it makes the solution structured and fast.

Feel free to ask your questions.

Target Audience

Anyone who is looking for software automation on Python for websites or some API

Comparison

I believe there are similar libraries on Typescript as codecept and maybe something similar on python , but usually it is project specific

/r/Python
https://redd.it/1if6nk0
Customize Inline Model Position in Django Admin

Hello everyone!

A few days ago, I ran into an issue while working on one of my projects—a university course selection system. The problem was how to change the placement of inline models.

By default, Django places them at the bottom of the page, but I wanted to position them wherever I needed.

After extensive searching and using AI tools, I couldn’t find a solution. So, I decided to figure it out myself—and finally, I found the answer!

I talked about it in detail on my YouTube channel and shared the final solution in a tutorial.

Hope you find it helpful!

Watch the video here :

https://youtu.be/utUuwUj67oc?si=3MV74_pDHL6PoEkp

/r/django
https://redd.it/1ifhjwj
Problem with connection with server

I'm creating a flask app following the mega-tutorial of Miguel. I'm trying to send an email to me but i receive this error:

ConnectionRefusedError: [WinError 10061\] No connection could be made because the target machine actively refused it

How can i resolve it? I think because the client port is different from server port.

/r/flask
https://redd.it/1if5erj
htmx + Django + Cursor AI is a legit dream.

I am legit blown away. I've been using Cursor lately and I don't think I can go back anymore. Especially when it comes to fullstack development. For those of you not using AI to level up your development I would highly recommend starting.

backstory - I wanted to add a public playground section for my application which included a backend, frontend, and some internal integrations with my existing stuff and about 30 new files and 8k new lines of code later its working just how I want. The best part is it took me 1 day and just prompted the entire thing. Didn't write one bit of html for it. I've been in software engineering for 8 years so I've seen trends come and go but at this point I'm 100% sold on this.

This thing handles django templates with htmx so unbelievably well that I'm convinced anyone can build something very impactful in very little time.


Here's a video of the whole thing https://app.arcade.software/share/4BHHh6THSWxGWCzRBwTd

I wanted

1. To share with you all that this combo, whatever new acronym people end up calling it, is awesome. Big win for the SSR community.

2. Should I live code a session or

/r/django
https://redd.it/1ifnpjz
Parameters for each Django Model Field

I'm really new to django and I cannot find an itemized list of the optional parameters available for each model field. There don't seem to be complete listings in the model fields reference. Anyone know where I can find this information? It's proving much harder than I imagined.



/r/djangolearning
https://redd.it/1ifg7yp
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/1ifk63x
FastAPI Deconstructed: Anatomy of a Modern ASGI Framework

Recently I had the opportunity to talk about the FastAPI under the hood at PyCon APAC 2024. The title of the talk was “FastAPI Deconstructed: Anatomy of a Modern ASGI Framework”. Then, I thought why not have a written version of the talk. And, I have decided to write. Something like a blog post. So, here it is.

https://rafiqul.dev/blog/fastapi-deconstructed-anatomy-of-modern-asgi-framework

/r/Python
https://redd.it/1ifu2sv
Recently Wrote a Blog Post About Python Without the GIL – Here’s What I Found! 🚀

Python 3.13 introduces an experimental option to disable the Global Interpreter Lock (GIL), something the community has been discussing for years.

I wanted to see how much of a difference it actually makes, so I explored and ran benchmarks on CPU-intensive workloads, including:
- Docker Setup: Creating a GIL-disabled Python environment
- Prime Number Calculation: A pure computational task
- Loan Risk Scoring Benchmark: A real-world financial workload using Pandas

🔍 Key takeaways from my benchmarks:
- Multi-threading with No-GIL can be up to 2x faster for CPU-bound tasks.
- Single-threaded performance can be slower due to reliance on the GIL and still experimental mode of the build.
- Some libraries still assume the GIL exists, requiring manual tweaks.

📖 I wrote a full blog post with my findings and detailed benchmarks:
https://simonontech.hashnode.dev/exploring-python-313-hands-on-with-the-gil-disablement


What do you think? Will No-GIL Python change how we use Python for CPU-intensive and parallel tasks?


/r/Python
https://redd.it/1ift077
PedroReports-An Open Source LLM Powered Automated Data Analysis Report Generator Tool

Hey devs! Sharing my first project - an AI-powered PDF Report Generator! 🐍📊

## GitHub: https://github.com/bobinsingh/PedroReports-LLM-Powered-Report-Tool

I recently switched my career from life sciences to coding, and I wanted to create something useful after learning. So I built a tool that generates professional data analysis PDF reports from any tabular dataset. You just need to input what you want to analyze, and it does the job for you. Thought you might find it interesting!

# What My Project Does:

- Takes your dataset and analysis requirements as input in the form of questions
- Uses Gemini API to generate graphs and relevant stats to answer your questions
- Generates a professional PDF with proper formatting
- Handles TOC, styling, and page numbers automatically

# Target Audience:
- Data Analysts, BI reporters
- Data Science beginners who want quick data insights
- Researchers who are not friendly with coding

# Comparison
- There are a lot of BI tools out there but not sure if they generate PDF reports or not.

## Tech Stack:

- Python + ReportLab for PDF generation
- React + Vite for frontend and development server
- LangChain + Gemini API for analysis
- Pandas/Numpy/Matplotlib for data processing

The workflow is simple: feed it your data, and it handles everything from

/r/Python
https://redd.it/1ifqz4j
I made this! Flask and Jinja templates, and MongoDB for the database.

https://www.spacetranslate.org/


/r/flask
https://redd.it/1ify31e
Django looks like a play

I can see why Quentin wants to do theatre plays I think he could do a TV series as well Django looks like a live play lol

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