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
Celery Rolling Updates on a VPS

Let's say I'm pushing out an update to Celery running on a VPS, but there's a task running. How do I handle a rolling update? I want to wait for the task to complete or at the very least re-queue it. How does this work running on a VPS? How would this work running on Kubernetes? Thanks!

/r/django
https://redd.it/1czisvl
Caching full page responses with a service worker for a MPA.

Hi all, I'm in the process of building the PWA for my Django web-app, which was built as a MPA (mainly for the ease of it for SEO).

I'm attempting to cache the full responses for certain pages so that they then load instantaneously with no request ever even sent to the server for the rendering of the page.

My sw.js is in my static directory.

Is this even possible? The page cache response never seems to be triggered, so nothing even saved to be able to attempt to retrieve, and from logs, it never even tries to check if there's something to retrieve either.

/r/django
https://redd.it/1czubid
I made a desktop chat app :)

What My Project Does

Hi! This is my first time doing a python project more than a few hours in size.

I made a chat app which features E2E encryption using a passcode and has a multiclient architecture.

All comments are welcome!


Target Audience

It is just a toy project for my portfolio.


Comparison

Compared to other chat clients, this one uses a passphrase to encrypt all data, with the passphrase being chosen out of the app, for instance on a dinner.

But I think that IRC already has this, so it doesn't differ much XD.


Git link:

https://github.com/xxzoltanxx/Balvan-Chat

/r/Python
https://redd.it/1cznlay
Django drf authentication

Hello, I'm new to Django I'm trying to create authentication system with drf and vue js. Which is the best package for this ? I'm looking for the best security and maintainability for the future.

I can see that djoser and allauth are the popular ones, which one is better ? (I don't need social authentication)

Thanks

/r/django
https://redd.it/1czxa1c
I am a Flask Developer who wanted to have Anonymity with the Freedom to Express and Share anything, so I created an app so that everyone can have that freedom!

Ticket to Anonymity

AtTweeter you are not a data that would be stored in a database, but you are a anon user with no credentials or information. Now you may think, where does the message go? The messages that a user send is actually stored inside a list, which is impossible to be traced back to the sender (because the messages don't include your nametag, or any data associated to you). Also, we do timely message clear too, so the conversations are not permanent.

Imagine: My friend, let's pretend his name is Alex, wanted to have a heartfelt conversation with his girlfriend about their future plans, but he was worried about the privacy of their discussion. He didn't want their intimate moments to be intercepted by prying eyes or data-hungry algorithms.

That's when I introduced him to AtTweeter 𓅦 – a revolutionary social app designed with privacy as its cornerstone. With AtTweeter, Alex and his girlfriend were able to chat freely, knowing that their conversations were shielded from any unwanted surveillance.

But that's not all! There is a section called Game Arena, where you and your friends can bond over nostalgic old games (remember the game called snake?) and challenge each other to climb

/r/flask
https://redd.it/1czozvd
Host flask website on tor

I downloaded tor on linux, and changed the config to expose the port and used nginx to host a static website, following this video - https://www.youtube.com/watch?v=bllS9tkCkaM now i stopped the nginx service and then i ran flask on port 80 by adding it into app.run and running the thing using sudo (also had to use sudo shell to install flask from pip and then run using python3 app.py as it was showing flask not found if i ran it with sudo but worked when ran normally so i installed flask again using sudo) and now as it's running on port 80 i can access it using tor, it works but my question is - is this how you are supposed to host it? Do i need to configure something else? In the video we configured nginx at 20:00 which he said would make the website "a bit safe" what else do i have to do?

/r/flask
https://redd.it/1czk39o
How do you do long streaming Asynchronous API in Django?

We have a prototype to built, and because of availability of Developers and for some legacy reasons, we need to build the same in Django. Our preferred choice is Django-Ninja API framework (which is almost like FAST API)

While the domain is stocks and trading, customer wants it have a look and feel like Insta or FB Post with comments, and other social media interactions. So you have likes, and a few more other ways to tag comments from different users on a Post.

So every Post which is basically an offer on selling something is likely to see a lot of interest by 1000s of other users, and hot offers is expected to see hundreds of interactions every minute.

This means the API is likely to be updated every second, and every one needs to see transparently what is going on. There will also be a 10X of silent lurkers. Which means the feed will be reaching 10,000 plus users and may be 100-1000 changes to the feed API every minute at peak.

Application is likely to have a web as well as mobile client side.

How do we build a long running streaming API?
We are running multiple

/r/django
https://redd.it/1d050b6
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/1czz465
D Should Google AI Overview haven been released ?

Yet another bad AI feature release from Google (see reactions in NYT article 5/24). When your read how bad some of the overviews are, it makes you question if Google product team was really thinking about how people will use their products. Almost seems adversarial testing was not done.

If AI Overview is really intended to summarize search results using AI, how is it supposed to work when significant percentage of websites are full of unreliable information including conspiracy theories and sarcasm.

Does anyone truly need a summary of an Onion article when searching?
'Move fast and break things, even if the product you are breaking pulls in 40 billion/year'

/r/MachineLearning
https://redd.it/1czzt45
My Jr Developer resume

/r/django
https://redd.it/1d05jrr
Xenharmlib - An advanced music theory library that supports microtonality

Introducing Xenharmlib (Source code here)

What My Project Does

(taken from the docs) Xenharmlib is a music theory library for the exploration and research of microtonality, diatonic set theory, non-standard notations, and many more. The library implements a superset of Western classical music theory, so you can also use it to compose and analyze music in the boundaries of the common practice period or 20th century Western music.

Target Audience

Composers who want to get answers to theoretical questions pertaining to structures of musical scales, note intervals, frequencies and frequency ratios in equal division tunings. People who want to explore microtonality or non-western musical theory in general.

Comparison

* mingus Xenharmlib is pretty much on-par with features in mingus, however extends those features to all sorts of equal division temperaments.
* pytuning supports more slightly tuning methods and export formats, however does not support microtonal notation or note / interval calculation
* music21 is much more mature in providing an analytical toolset, however supports only traditional western equal temperament

/r/Python
https://redd.it/1d0gots
PyPods: A lightweight solution to execute Python dependencies in an isolated fashion.


Introducing PyPods

What My Project Does

A Python library designed to manage monolithic project architectures by isolating dependencies.

Traditionally, monolithic architectures cluster all dependencies into one project, creating complexities and potential conflicts. PyPods offers a solution by isolating these dependencies and enabling the main project to communicate with them via remote procedure calls.

This approach eliminates the need to install dependencies directly in the main project. Feel free to take a look and I am happy to receive some feedback!

Target Audience

Production grade.

Comparison

This solution is inspired by Babashka pods in the Clojure world.

/r/Python
https://redd.it/1czxc2a
Help needed. Problem with my jupyter notebook.

Well i installed conda and when i open jupyter notebook it looks like this:

https://preview.redd.it/e58njrswim2d1.png?width=1902&format=png&auto=webp&s=8ceaec4d9b73ef4988abf1c3f99b474fc957fc58

It didnt use to look like that. Now its just ugly. The problem happened after i uninstalled anaconda and reinstalled it.

/r/JupyterNotebooks
https://redd.it/1d0jisk
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/1d0p0iv
Custom authentication

I have a custom email authentication system. What I do not fully understand is why it works with login_view() without creating a specific view for logging in with email. The form works with email or username and the email gets authenticated in the login_view authenticate() method event though email=username is not being passed. Any assistance will be greatly appreciated. Thank you.

login.html

<div class="login-form-container">
<h1 class="login-form-containerheader" >Please Login</h1>
<form action="" method="POST" class="login-form-containerform">
{% csrftoken %}
{{ form.as
p }}
<button type='submit'>Login</button>
</form>
</div>

settings.py

AUTHENTICATIONBACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'account.email
authentication.EmailAuthBackend',
]

views.py

def loginview(request):
form = LoginForm(
request.POST or None)
if form.is
valid():


/r/django
https://redd.it/1d0sxn2
Looking for open source projects

Hello. Let me introduce myself briefly: I live in Turkey. I have a bachelor's degree in engineering, a master's degree in philosophy, and I am currently a doctoral student in philosophy. I worked as a full-time back-end developer at one of Big4 companies for 4 months. I used technologies such as Python, Java, Django in my amateur projects, but in my professional experience I used PHP and Spryker.

I want to continue my career abroad (Germany, UK). I am aware of the crisis in the IT industry. I am looking for alternative ways other than constantly seeing the same ads on LinkedIn and applying. Maybe reddit can help me, who knows.

I want to expand my network and evaluate my chances of finding a possible job. If you have open-source projects, I would like to be involved. Also, I am open to any suggestions. If anyone wishes, I can share my GitHub and LinkedIn accounts via DM.

/r/django
https://redd.it/1d0ndh2
Spotify Lyrics visualizer

What My Project Does

Because spotify made their lyrics menu a premium only feature, I thought I'd make my own replacement for it.
The app connects to your spotify account, fetches the lyrics from various websites, and then syncs them automatically to what is currently playing. Basically does the exact same as the lyrics menu used to do.

Target Audience

Anyone who wants to see the lyrics to songs really.

Comparison

Most other apps that I've found are either browser only, or don't actually sync the lyrics to the song, they just show the entire lyrics at once.
In comparison, my app shows the lyrics line by line, synced with the song, and also has (in my opinion lol) a fairly nice looking ui.
It's also very easy to use for non programmers too, since you can just download an executable to use the app.

It's available for free here https://github.com/Mews/spotify-lyrics



/r/Python
https://redd.it/1d0nb3k
I created an unofficial module for the ShipEngine API

What My Project Does

Simplifies the interaction with the ShipEngine API with most response and requests built as objects, which in my opinion makes interaction much easier. This is my first released package so all criticism and feedback is very welcome.


Target Audience

Anyone who deals with the current ShipEngine API using Python.


Comparison

There is an official ShipEngine API module that is created by the company but I have found it somewhat lack luster with no way to create batches or bulk shipments (and other missing functionality), this is much more suited to accomplishing that task.


Links

https://github.com/Sen-tio/unofficial-shipengine

/r/Python
https://redd.it/1d0qkfd
Rye-Tui, a Text-based User Interface (TUI) to manage rye projects

Hi everyone, Ive reached a state of my current project, where I want to share it with you, and gather some feedback. This is my first time using rye and I am surprised, how Hassle-Free building a package with it went.
Source Code: github

# Installation
python -m pip install rye-tui

for CLI Tools I recommend using pipx or rye.
pipx install rye-tui

rye install rye-tui

After Installation you can open the TUI using trye in your Terminal. On first use a config file is generated. After that use trye again in your rye managed project

# What My Project Does
A Text-based User Interface (TUI) for rye written in python using Textual

# Current State
Currently rye-tui supports the following functionalities of rye:

- creating new projects (flag-support coming soon)
- adding normal and dev dependencies (flag-support coming soon)
- pinning versions
- Syncing (flag-support coming soon)
- changing rye's configuration (sources and default coming soon)

# Target Audience
Python developers and rye users who like a UI to manage their rye projects.

# Comparison
To my knowledge there is no similar tool for rye. Maybe the Anaconda UI comes closest for Anaconda Users.

# Last Words
Feel free to try(e) it out. Happy to hear your feedback.

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