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
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
Example large open source rest API?

I started reading Indico, but looks like it is mostly a server rendered app rather than an API and SPA. Are there are other large examples that I can read?

/r/flask
https://redd.it/1i9cewi
Need Help Improving My Resume – Seeking Ideas and Feedback!

I’m currently in the process of updating my resume and could really use some fresh ideas or suggestions to make it stand out. I’m applying for a Python Django Developer/Full Stack Developer role, and I want my resume to effectively highlight my skills and experience.

Here’s a bit about me:

Experience: I have 2 years of experience as a Python Django Trainer, where I’ve taught aspiring developers and built a strong foundation in Python, Django, and web development. I’m now transitioning into Full Stack Development roles to apply my technical and teaching expertise in real-world projects.
Skills: Python, Django, JavaScript, REST APIs, SQL, Git, and front-end tools like Tailwind CSS and Bootstrap. I also have experience with creating and deploying projects using Django, collaborating with teams, and building RESTful applications.
Career Goal: I aim to grow as a Full Stack Developer by contributing to innovative projects, building scalable solutions, and exploring modern web development practices.

If you have any suggestions for improving the structure, format, or content of my resume, I’d really appreciate your input.

Are there specific sections or layouts that work best for tech resumes?
What’s the best way to showcase teaching experience in a way that resonates with recruiters?


/r/djangolearning
https://redd.it/1i8122h
Need Help deploying React + Flask

Hi, flask newbie here


i spent quite a while developing a react and flask application thats pretty simple,

react fronend, sends post requests and get requests to flask backend, uses routing aswell.

i had it up working fine with localhost:5000 and localhost:3000 and now I'm trying to deploy it,
tried to use Dockerfile with render and deploy them both at the same time, ended up being really frustrating so i switched to using a digitalocean droplet, and following a tutorial that got me setup with nginx, but because my flask backed doesnt really display anything i am having trouble debugging - i set up a system service on the droplet (just a linux vm) so a gunicorn process is alway running, but i cant visit it properly. also i have a domain but it doenst seemt o work with nginx.

any advice on deployment?
Thanks

/r/flask
https://redd.it/1i95cz0
Any reason to NOT use Pyright?

Based on this comparison (by Microsoft): https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html

It seems Pyright more or less implements nearly every specification in the Python Type System, while it's competitors are still lagging behind. Is there even any reason to not use Pyright (other than it relying on Node.js, but I don't think it's that big of a deal)? I know MyPy is the so-called 'Reference Implementation' but for a Reference Implementation it sure is lagging behind a lot.

EDIT: I context is which Type Checker is best to use as a Language Server, rather than CI/CD.

/r/Python
https://redd.it/1i8pm2f
blackjack from 100 days of python code.

Wow. This was rough on me. This is the 3rd version after I got lost in the sauce of my own spaghetti code. So nested in statements I gave my code the bird.

Things I learned:
write your pseudo code. if you don't know **how** you'll do your pseudo code, research on the front end.
always! debug before writing a block of something
if you don't understand what you wrote when you wrote it, you wont understand it later. Breakdown functions into something logical, then test them step by step.

good times. Any pointers would be much appreciated. Thanks everyone :)

from random import randint
import art

def checkscore(playerlist, dealerlist): #get win draw bust lose continue
if len(player
list) == 5 and sum(playerlist) <= 21:
return "win"
elif sum(player
list) >= 22:
return "bust"
elif sum(playerlist) == 21 and not sum(dealerlist)

/r/Python
https://redd.it/1i8xqld
Zoho's ZeptoMail has released a Django integration pip package.

/r/django
https://redd.it/1i9jh9n
Django Ninja vs DRF for Async ? Seeking Advice

Hey everyone,

We’re building an API for our app, and while we really want to use Django, we need robust async capabilities since we’ll be making external API requests (e.g., OpenAI, LLMs).

We’re torn between Django REST Framework (DRF) and Django Ninja. While Django Ninja supports async out of the box and looks very developer-friendly, we’re concerned about its long-term support and community size compared to DRF. Future-proofing our app is important since this API will be a core part of our project.

For those who have used Django Ninja in production, would you recommend it? What are your experiences with its stability and scalability?

If not Django Ninja, how would you approach incorporating async functionality into a DRF-based API? Any advice or recommendations would be greatly appreciated! We will definitely use Celery for some tasks but rn we're looking for a solution for immediate responses.

Thanks in advance! 🙏


P.S. We also need robust permission handling since we need to be HIPAA compliant.

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