Python Daily – Telegram
Python Daily
2.56K subscribers
1.49K photos
53 videos
2 files
39.1K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Django-Q2 in Azure Web App

I'm trying to migrate an overgrown POC app from an ex-colleague's desktop to the cloud. It's urgent, so I had to just figure out a plan of action quickly and run with it.

The app is a Django application with management dashboard, along with a whole range of tasks that need to be run at specific times throughout the day.

My colleague used to just run the server on his machine and have some Cron jobs configured for the tasks.

I've turned the Cron jobs into Django-Q2 schedules, which seem to run fine locally.

I've made 2 Azure Web Apps, one that starts up the Django application and hosts the dashboard with the "runserver" command in the startup noscript,which runs fine.

The other should be responsible for running the jobs, so it sets up the schedules in the startup noscript and then runs the "qcluster" command.

This last app keeps restarting, with message "Site startup probe failed after X seconds" and the jobs are not being executed (correctly). I assume this is because this app does not host a web server that can be probed by Azure, but I'm not sure.

2 questions:
* How can I quickly work fix / work around this issue so the app

/r/djangolearning
https://redd.it/1h7z3dc
Astral (uv/ruff) will be taking stewardship of python-build-standalone

An interesting blog post explaining how python-build-standalone is used:

> "On 2024-12-17, astral will be taking stewardship of python-build-standalone ..."

- https://astral.sh/blog/python-build-standalone

/r/Python
https://redd.it/1h8qoxl
Python .gitignore

I'm sure a lot of you have done this:

1. Start new project
2. Need that generic Python .gitignore file on GitHub
3. Google "python gitignore" (though you probably typed "gitingore")
4. Click link and click raw
5. Copy all and paste in your local .gitignore

And I'm sure a lot of you probably just use curl and have it memorized or have it in your shell history or something (fzf ftw). But I can't be bothered to learn curl properly, and I got tired of the manual steps, so I just created a function in my .zshrc file:

function pgi {
curl -JL https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Python.gitignore -o .gitignore
}

So now I can just run pgi whenever I start a new project, and boom, precious seconds of my life saved.

That's it, that's all I have, thanks for reading. I'm sure some of you have ever better solutions, but that's mine.

/r/Python
https://redd.it/1h8rc4g
For those that pay under $50 total in infra costs, what is your app doing?

I’ve seen a lot of people post about how they pay less than $50 in total costs so I’ve had a few questions for you.

What is the purpose of your app?
How much traffic does it see?
What kind of functionality does it support?
What are you using for your DB?
How’s the performance?
What’s the server config?

/r/django
https://redd.it/1h8tez7
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 noscript 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/1h95vc3
Dubt about what the user have to see on page source code.

Is it a problem if i see this on my page source code from browser?

<input id="csrftoken" name="csrftoken" type="hidden" value="ImY3N2E3MzMxNzBkMGY0MGNkYzRiYzIyZGZkODg2ZmFiNDA1YjQ1OWMi.Z1S5sg.5OTK7El82tJoEyCSGVGdahZyouc">

/r/flask
https://redd.it/1h92fch
I built PdfDing using Django

Hi,

over the past six months I have built PdfDing using Django. It is a selfhosted PDF manager and viewer offering a seamless user experience on multiple devices. You can it on GitHub. Some of its features include:

Remembers current position - continue where you stopped reading on any device
Share PDFs with an external audience via a link or a QR Code. Shared PDFs can be access controlled
Dark Mode, colored themes and custom theme colors
Inverted color mode for reading PDFs
SSO support via OIDC

PdfDing was my first real web app projects and my first using Django. The start was a bit rough, but afterwars it has been a blaze :). Feature development is fast and a lot of information is available online.

Other than Django the techstack includes:

the frondend is build using Alpine.js, htmx, jQuery and Tailwind CSS
authentication, registration, account management and OIDC is achieved by django-allauth
Mozilla's PDF.js is used for viewing PDF files in the browser

If you like PdfDing I would be really happy over a star. As the project is open source, if anyone is willing to contribute you are welcome!

/r/django
https://redd.it/1h9eitd
Stripe alternatives for subnoscription

Hi everyone! Recently I published my wife platform and we are using stripe.

The total cut by them is \~5% and I wonder if is there any alternative I am not aware that we can use which offers better rates.

Does anyone has an experience with other services?

/r/django
https://redd.it/1h9gmhv
D Self-Promotion Thread

Please post your personal projects, startups, product placements, collaboration needs, blogs etc.

Please mention the payment and pricing requirements for products and services.

Please do not post link shorteners, link aggregator websites , or auto-subscribe links.

--

Any abuse of trust will lead to bans.

Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the noscript.

--

Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.

/r/MachineLearning
https://redd.it/1h99kae
RedSage is a terminal-based pair programming assistant that integrates with LLMs. Opensource.

Need a junior developer that can program with you? I built one in Python.

What my project does?

After installing the program, you can start RedSage right from your terminal. It’s an AI-powered pair programming assistant that connects to LLMs like OpenAI and Claude to help you write code, explain concepts, and even review your changes in real-time.

Comparisons:

Unlike complex IDE plugins, RedSage is lightweight and works directly from the command line, giving you intelligent code suggestions, context-aware explanations, and seamless Git integration without the overhead. Think of it as having a junior developer by your side, but with no setup hassles and a super-fast workflow. Perfect for anyone looking for a simple, yet powerful coding companion.

LINK: https://github.com/chisasaw/redsage


Conclusion:

I'd like your feedback and project direction. It's entirely built in Python and available on Github. The link i above.



/r/Python
https://redd.it/1h9jd21
ARM Native Python execution time higher than x64 Python?

I am running below python code X Elite Surface Laptop 7. With python x64 and arm64 (3.11.8)
I get below execution speeds:

x64: 28.32 seconds
arm64: 33.34 seconds

I have run it multiple times, I get similar values. I was expecting native python to run much faster than emulated python.
What am I missing? Also please point to different sub if needed.

import time
import math

def calculatepi(iterations):
pi = 0
for i in range(iterations):
pi += 4 * (-1)**i / (2 * i + 1)
return pi

if name == "main":
iterations = 100000000
start
time = time.time()
pivalue = calculatepi(iterations)
endtime = time.time()
elapsed
time = endtime - starttime
print(f"Pi value: {pivalue}")
print(f"Elapsed time: {elapsed
time:.2f} seconds")

I am running below python code on X Elite Surface Laptop 7.
With python x64 and arm64 (3.11.8), I get below execution speeds:

x64: 28.32 seconds
arm64: 33.34 seconds

I have

/r/Python
https://redd.it/1h9o1ed
How OAuth and normall user signup/login will work together

I know it's naive but I can't grasp the whole process of it.

I am creating a app (Django, React, Postgres) and I have normall Login/Signup via my own RESTful endpoints and I also want to give my users the option to signup with Fb/google etc.

For my own RESTful views I'm using Toke authentication but I am not sure how the OAuth Access token will work with that
Do I need to create a authentication token after successful authorization from Resource server ??

I hope It's not a bad question
Thanks

/r/django
https://redd.it/1h9o1m2
I added Bootstrap templates to Neapolitan - Quick CRUD views for Django

I just contributed example templates to Neapolitan (Carlton Gibson's CRUD views library). Create full CRUD interfaces with 4 lines of code!

I Made it work with Bootstrap + Crispy Forms - would love your feedback!

https://github.com/carltongibson/neapolitan/pull/72

/r/django
https://redd.it/1h9lzgm
Deply 0.5.1 Released: New Collectors, 10x Performance Boost, and Stronger Architectural Rules

Hello everyone,

It's Archil again, checking in from Wrocław, Poland. I'm excited to announce the release of Deply 0.5.1, an updated version of my Python tool for enforcing architectural patterns and dependencies in larger codebases. I've noticed steady downloads since the previous post, and I'm genuinely grateful to everyone who has tried Deply or provided feedback.

# What My Project Does

For those new here here is my previous post, Deply analyzes your code structure and verifies that your Python project adheres to a defined architecture. You specify layers, set rules, and Deply enforces them—helping maintain clean, modular, and maintainable code as your project grows.

# Target Audience

Ideal for developers and teams building medium to large Python applications who need to maintain clear, enforceable architectural boundaries. It also suits those aiming to teach or learn best practices.

# Comparison to Other Tools

• pydeps:

Focus: Visualization of dependencies

Comparison: pydeps provides a visual map of imports, helping you understand how parts of your code relate. Deply goes further by actively enforcing rules on these dependencies, ensuring that your project structure adheres to architectural guidelines instead of merely displaying it.

• import-linter:

Focus: Import-based dependency constraints

Comparison: import-linter is excellent for managing import hierarchies and preventing forbidden dependencies. Deply builds on this

/r/Python
https://redd.it/1h9qjjj
Python Django Backend Developer | Software Engineering Student

Hi guys, I am looking for a job/internship as a Django backend developer. Tbh I think I am very highly qualified as a fresher. I am also learning React js. So, do you have any opportunities in mind for me?

/r/django
https://redd.it/1h9clhl
Monday Daily Thread: Project ideas!

# Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

## How it Works:

1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.

## Guidelines:

* Clearly state the difficulty level.
* Provide a brief denoscription and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.

# Example Submissions:

## Project Idea: Chatbot

**Difficulty**: Intermediate

**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar

**Denoscription**: Create a chatbot that can answer FAQs for a website.

**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)

# Project Idea: Weather Dashboard

**Difficulty**: Beginner

**Tech Stack**: HTML, CSS, JavaScript, API

**Denoscription**: Build a dashboard that displays real-time weather information using a weather API.

**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)

## Project Idea: File Organizer

**Difficulty**: Beginner

**Tech Stack**: Python, File I/O

**Denoscription**: Create a noscript that organizes files in a directory into sub-folders based on file type.

**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)

Let's help each other grow. Happy

/r/Python
https://redd.it/1h9wkuk
Sharing Smoke Simulation Project I have Been Working On

Hello all, I have been working on this project for quite some time and found it to be very useful for my task as a software engineer trying to build Computer Vision applications. My daily job involves working with smokey images and finding models but getting smokey images on demand was not possible and hence I came up with an idea to make a simulator. I modified the existing solution from bijection/smoke.js and implemented it with Python.

Links:

GitHub Repo: [https://github.com/q-viper/SmokeSim/](https://github.com/q-viper/SmokeSim/)
Demo: https://q-viper.github.io/SmokeSim/ (This demo is from only the JavaScript Version.)

## What My Project Does

It simulates a reproducible smoke image using PyGame. The property of the smoke and its particles can be controlled by the properties like size, velocity, lifetime, color, etc. In addition to that, this package can act as an image augmentation and can return the overlayed smoke mask, overlayed image, and smoke too.

## Target Audience

The main target audience would be anyone who is working on Computer Vision projects or image augmentation and looking for a cool way to increase training images. However, anyone who is interested in building something fun with Python and collaboration might find it interesting.

## Comparison

There are packages like Torchvision and Albumentations and this feature

/r/Python
https://redd.it/1h9t8r7
Python Quiz for Beginners and Experts

Curated a 40 questions quiz on Python coding. Test your knowledge with this quiz. Would love to know your score and feedback!!

I will keep updatig this quiz to make it more comprehensive.

Try this Python quiz here.

/r/Python
https://redd.it/1h9fg6x
How can I host my dynamic Django website, which includes an ML implementation like a BERT model, for completely free?

Hey, I want to host my dynamic Django website, which includes ML implementations like a BERT model, an NSFW detector, and CNN, for free because I don’t have any money. I’m just a student, or you could say someone learning ML and DL from the internet. I’m not someone who’s completely mastered coding yet, so I haven’t landed a job—I’m still learning the code and math behind it all. I also come from a non-tech background.

With what I’ve learned so far, I want to expand my knowledge by implementing it in a website. However, I can’t afford to pay for hosting. I know some platforms, like AWS Free Tier, offer free services for 12 months, but what happens after that? From where would I pay? Also, I’m not expecting the website to become popular overnight—it might take more than a year to gain traction.

Can anyone suggest completely free hosting solutions for projects like this? Any advice or guidance would mean a lot!

/r/django
https://redd.it/1ha0h34
Convert Figma design into Python code

🔗 Link — https://github.com/axorax/tkforge

# What My Project Does

TkForge is a Python app that allows you to turn your Figma design into Python tkinter code. So, you can make a GUI design in Figma and use specific names like "textbox", "circle", "image" and more for interactable elements then use TkForge to get the code for a fully functional working GUI app from your design.

And it's free, open-source and regularly maintained!

# Target Audience

TkForge is made for anyone who wants to make a GUI with Python easily and efficiently. It's fast and you can make some really complex and beautiful GUI's with it.

# Comparison

There's another project similar to TkForge called Tkinter Designer. Personally without being biased, I think TkForge is better. TkForge supports everything Tkinter Designer does and more. TkForge generates better code, supports more elements, allows you to add placeholder text (which you can't by default in tkinter), automatically sets foreground color and a lot more! Placeholder text and foreground color generation is a bit buggy though. I use TkForge for most of my tkinter projects. You can get help in the Discord server.

# Updates

I updated the app to support multiple frames, fixed a lot of previous bugs and added checks

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