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
R ENERGY-BASED DIFFUSION LANGUAGE MODELS FOR TEXT GENERATION

https://arxiv.org/pdf/2410.21357

The authors of this paper combine diffusion models with energy based modeling to address the challenges in discrete generative modeling.

/r/MachineLearning
https://redd.it/1i87lgy
Python flask hosting help

Hello i am still relatively new to programming and developed a python flask app that uses openai api call to respond to user input. My application works fine locally but continues to crash during the build whenever i try to host it. Ive tried Vercel as well as Digital Ocean and Fly.io

/r/flask
https://redd.it/1i8bnd6
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/1i8i144
Test & Code. Why is pytest-cov the number 1 pytest plugin? Here's my take on it.

Listen here [https://testandcode.com/episodes/pytest-cov](https://testandcode.com/episodes/pytest-cov)

Discussed:

* what Coverage.py is
* why you should measure code coverage on both your source and test code
* what pytest-cov is
* extra features pytest-cov gives you over and above coverage.py
* and generally why using both is awesome

/r/Python
https://redd.it/1i8kys9
Fastapi deployment posting here for help



Newbie in Deployment: Need Help with Managing Load for FastAPI + Qdrant Setup

I'm working on a data retrieval project using FastAPI and Qdrant. Here's my workflow:

1. User sends a query via a POST API.


2. I translate non-English queries to English using Azure OpenAI.


3. Retrieve relevant context from a locally hosted Qdrant DB.



I've initialized Qdrant and FastAPI using Docker Compose.

Question: What are the best practices to handle heavy load (at least 10 requests/sec)? Any tips for optimizing this setup would be greatly appreciated!

Please share Me any documentation for reference thank you

/r/flask
https://redd.it/1i8ngub
DRF first or wait?

In a hypothetical situation where you wanted to deliver an MVP with minimal functionality to showcase an idea, but you knew one day it would also be an app, would you build DRF from the beginning or iterate into DRF over time?

/r/django
https://redd.it/1i8p177
I made this using Django and tailwind

I’ve been learning Django for the past year and working on various small projects. While searching for ideas to build a project that could solve real-time problems, one of my photographer friends suggested an idea: "Hey AJ, can you build something where I can share and showcase my event photos with clients?" (He’s a wedding photographer.) He wanted a way to share photos of live weddings through a website, using a QR code.

Inspired by this, I built **ShareMySnaps** —a platform that allows users to create digital albums in minutes. Although there are many products available in the market, this project was entirely for my learning experience.

Here are some features of the app:

1. Users need to sign up via their Google account.
2. On the dashboard, users can create a folder, which will automatically be created in their Google Drive.
3. When users click to upload an image, they are redirected to their Google Drive page to upload.
4. Users can download a beautiful QR code that links to their gallery page.
5. The gallery page fetches all the photos from the specific folder and showcases them on the gallery website.
6. Each gallery has its own dedicated page, and these pages are customizable (currently, the

/r/django
https://redd.it/1i8qzzg
Is it possible for non-IT person to get a part-time job in django?

Does an IT degree really matter?

/r/djangolearning
https://redd.it/1i804cq
how to learn Flask

I would like to learn Flask and SQLite to make simple web apps for hobby.
What are the best resources? Any course or video you would recommend?

/r/flask
https://redd.it/1i7t50n
Need help in getting zip files from Postman on Flask server and using it

from
flask
import
Flask, redirect, url_for, Blueprint, request, jsonify
from
myproject
import
db
from
myproject.manager.models
import
Manager, Events
from
flask_jwt_extended
import
create_access_token, jwt_required, get_jwt_identity
from
datetime
import
datetime
import
zipfile
import
os
from
io
import
BytesIO
from
werkzeug.utils
import
secure_filename

manager_bp = Blueprint('manager_bp' ,__name__)


@manager_bp.route('/sign-up/',
methods
=['POST'])
def sign_up():


/r/flask
https://redd.it/1i8yl1x
Can my Flask app be downloaded?

If I'm running Flask / Gunicorn and Traefik in Docker, without any other webserver, can my app.py be downloaded?

/r/flask
https://redd.it/1i7vbfv
Open Source Load Testing with Locust: 13 years, 60 million downloads later

Hi, maintainer of Locust, the popular load testing tool for Python here 👋

Recently our project turned 13 years old, got its 25,000th GitHub star AND 60 millionth download*, so I figured now might be a good time to look back a little.

In fact, I wrote a whole blog article about it. The TL;DR of it is

* Expressing load tests in Python is still much more powerful than clicking around in a GUI

* Open source is fun, messy and benefits greatly from automated testing

* We're going to do tons of new stuff going forward (AsyncIO, freethreading, extended protocol support). Let me know if you want to contribute! There's also a hosted version nowadays (Locust Cloud)

A big shout out and thanks to the almost 300 people who have contributed so far. You rock.

Let me know if you have any comments on the article or on Locust in general, happy to answer any questions :)

* The truth is that nobody knows how many times Python packages have been downloaded, due to mirrors etc, but at least this one says its 61.3M https://pepy.tech/projects/locust?timeRange=threeMonths&category=version&includeCIDownloads=true&granularity=daily&viewType=chart&versions=2.32.7.dev14%2C2.32.7.dev9%2C2.32.7.dev8



/r/Python
https://redd.it/1i8xdsb
Resurrected: Announcing django-guardian 3.0.0rc1

Hi All,

Our beloved django-guardian (object level permissions for django) went unmaintained for a long time. After a lot of patience we've managed to resurrect the project and get all the permissions in place for the associated github, pypi, rtd accounts etc.

Today I released 3.0.0rc1 which brings django version support up to date and containes a whole ton of bugfixes, doc improvements and minor features. I'm very confident in it and expect to make this a full release over the next couple of months.

In this PR I explain why we've made this a major version release, although this shouldn't break your setup and *should* be a drop in replacement.

If you try this, please post because I want to hear your experience!



/r/django
https://redd.it/1i8tulm
Quick Question - New to Flask

I created a python script that generates the "Turning LED on" text in a web browser using the Flask API. After finding success with printing the text to the web browser, I attempted to import the GPIOZERO library and use the script to literally turn on an LED. Unfortunately, I cannot get it to work. I would appreciate any help with troubleshooting the code.

I tried creating local variables under the defined method. Please see below:

from flask import Flask

from gpiozero import LED

app = Flask(\_\_name\_\_)

u/app.route('/led/on')

def led\_on():

return "Turning on the LED"

return {'status': True}

led = LED(17)

green.on()



u/app.route('/led/off')

def led\_off():

return "Turning off the LED"

led = LED(17)

green.off()



Thanks in advance for the help!

/r/flask
https://redd.it/1i97rxc
DO THE TUTORIAL!!

So I'm on track graduating with my first cs degree this may.

I felt really uncomfortable because with only two classes left I really don't think I can build anything yet.

Our capstone project my group is doing a web based photo sharing platform and it led to me making this...

https://preview.redd.it/y26d5c1unnee1.png?width=866&format=png&auto=webp&s=035d969257c1a8c775f2f404845c1db05fc18d85

https://preview.redd.it/hc4y11xunnee1.png?width=892&format=png&auto=webp&s=e7516b37326877f981002308185e2ffc0494fe92

https://preview.redd.it/wemja97vnnee1.png?width=882&format=png&auto=webp&s=1117e08e1e0ae43eb7fa72b903e25e617bb81638

I made some more, and am aiming to complete one part of the tutorial a day, and been trying to document the process ([Here on my blog\](https://victorynotes.hashnode.dev)). I cannot stress how much the tutorial have helped me vs watching and following along youtube videos.

Really changed my world not only on learning django and other comsci process in general.

/r/djangolearning
https://redd.it/1i7t9xj
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/1i99x7w
Anthropic CEO says at the beginning of 2024, models scored ~3% at SWE-bench. Ten months later, we were at 50%. He thinks in another year we’ll probably be at 90% N

"One of the reasons I'm optimistic about the rapid progress of powerful AI is that, if you extrapolate the next few points on the curve, we’re quickly approaching human-level ability.

Some of the new models we've developed, as well as reasoning models from other companies, are starting to reach what I’d consider PhD or professional level. For example, our latest model, Sonnet 3.5, gets about 50% on SWE-bench, which is a benchmark for professional real-world software engineering tasks. At the start of the year, the state of the art was only around 3 or 4%. In just 10 months, we've gone from 3% to 50% on this task. I believe in another year, we could reach 90%.

We've seen similar advancements in graduate-level math, physics, and biology, with models like OpenAI’s GPT-3. If we continue to extrapolate this progress, in a few years, these models could surpass the highest professional human levels in skill.

Now, will that progress continue? There are various reasons why it might not, but if the current trajectory holds, that's where we're headed."

\- Dario Amodei. See the full interview here.

/r/MachineLearning
https://redd.it/1i8wkth
Bagels v0.3 update! Expense tracker that lives in your terminal.

Hi r/Python! I'm excited to share about the launch of Bagels 0.3 - a terminal (UI) expense tracker built with the textual TUI library! Check out the git repo for screenshots!

This new major version adds a whole new manager page, equipped with a display of 3 new plots (spending per day, cummulative spending trajectory and balance over time). The new budget section is designed to assist with saving part of your income and limit unnecessary spending!

The plotting is implemented with plotext!

# Target audience

Pain point: I find it annoying that my mobile budget tracker often gets out of sync with my actual balance when a record is missing, and I have no clue when that was. Also, it was frustrating that the most feature-rich budget trackers require you to pay to export your data.

Bagels is designed for you to conveniently enter your records at the end of each day, and store them in sqlite for easy export and processing if needed!

Comparison: Unlike traditional expense trackers that are accessed by web or mobile, Bagels lives in your terminal. Intended for you to check in and add records for the day, instead of doing so on the go with a mobile app.

#

/r/Python
https://redd.it/1i8xjry
Django + HTMX

I am playing around for a while now with this combo with mixed feelings.
It’s really hard to remain a clear structure when rendering only with partials, snippets and including it then in content…
Do you struggle with that too? Is there any helpful resource how not to lose track with the overall structure?



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