Python Daily – Telegram
Python Daily
2.56K subscribers
1.49K photos
53 videos
2 files
39K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Creating a multiplayer quiz game. Cant figure out how to create a lobby.

I'm trying to make backend for an online multiplayer quiz game. front end will be done according to the finished backend by someone else. premise is simple, users log in. they initiate the game, the game will show them both questions and a timer (calculated at front end), at the end someone will win and game will end. Game logic is simple, user creation and log in process is also simple. but I am having hard time on starting on how the matchmaking/lobby and match start process will work. any insights?

/r/djangolearning
https://redd.it/1h81rf2
Location of npm in my windows 11

I have been installing django-tailwind and when I was done. I somehow could run the

python `manage.py` tailwind install command because of the error below

CommandError:

It looks like node.js and/or npm is not installed or cannot be found.



Visit `https://nodejs.org` to download and install node.js for your system.



If you have npm installed and still getting this error message, set NPM_BIN_PATH variable in `settings.py` to match path of NPM executable in your system.



Example:

NPM_BIN_PATH = "/usr/local/bin/npm"


I am not sure how to solve this because I cannot find an npm.exe file anywhere

/r/djangolearning
https://redd.it/1h8p54m
Flet vs Streamlit PWA and conceptual questions

I'm new to flet, but I'm experienced Flutter developer plus I'm a Generative AI Engineer and worked with streamlit or Gradio. I have some conceptual questions.
Q1. If flet uses Flutter, then why does the flet Flutter plugin require a URL? Why cannot the flet UI "live" all together in Flutter?
Q2. Since there's a URL needed anyway, what's the advantage of using it vs for example having a Streamlit UI displayed in a PWA?
Q3. Let's say I develop a personal assistant in flet. Can the assistant access my location, heart rate, my camera (for multi-modal Gen AI), microphone and speakers (for voice assistant functionalities)?

/r/Python
https://redd.it/1h8nzyy
Async django, who is using it and why?

I am curious to know the use cases for async django, and whether there was a performance improvement in doing it.

/r/django
https://redd.it/1h8rd7v
Anyone Using Temporal?

I recently learned about temporal.io through a tech talk. Does anyone in the Django community use this as an alternative to something like Celery? It sounds too good to be true.

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