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
What’s Your Go-To Platform for Hosting Django Projects? 🚀

Hey guys! 👋 I’m curious to know what hosting platforms you’re using for your Django projects. There are so many options out there—AWS, DigitalOcean, Heroku, UpCloud, Linode, Render, Railway, Netlify, Flyio, etc. — each with its pros and cons.

Which ones is the best for you and why?

/r/django
https://redd.it/1hr7sgh
Quart-Schema 0.21.0 released

[Quart-Schema](https://quart-schema.readthedocs.io/) is a [Quart](https://quart.palletsprojects.com/en/latest/) extension that adds validation (request, response, etc) and autogeneration of OpenAPI documentation using either Pydantic, msgspec, attrs, or dataclasses. For example,

@dataclass
class Todo:
task: str
due: datetime | None

@app.post("/")
@validate_request(Todo)
@validate_response(Todo, 201)
async def create_todo(data: Todo) -> tuple[Todo, int]:
"""Create a Todo"""
# Do something with data, e.g. save to the DB
...
return data, 201

This latest release allows the auto generated OpenAPI schema to be fully customised by [altering Quart-Schema's OpenAPIProvider](https://quart-schema.readthedocs.io/en/latest/how_to_guides/customising.html). For example to use the function name as the operation ID,

class CustomOperationIdOpenAPIProvider(OpenAPIProvider):
def operation_id(self, method: str, func: Callable) -> Optional[str]:
return func.__name__

quart_schema = QuartSchema(app, openapi_provider_class=CustomerOpenAPIProvider)

/r/Python
https://redd.it/1hrd8w0
Looking to Collaborate on Django Projects (Open to Learning and Contributing)

Hi everyone,

I have a working knowledge of Django and a strong enthusiasm to improve my hands-on experience. I'm eager to contribute to any ongoing or new projects involving Django, be it for learning or collaboration purposes.

If you're working on Django and could use an extra pair of hands, I'm ready to help and learn along the way. I'm open to coding, debugging, testing, or any other tasks to contribute to the project.

Feel free to DM me or comment below if you're interested in collaborating!

Looking forward to working with you.

r/django
r/webdev
r/learnprogramming
r/coding
r/developers

/r/djangolearning
https://redd.it/1hr7148
Understanding null=True vs. blank=True

What is the difference between null=True and blank=True in Django models? Can they be used together?

/r/django
https://redd.it/1hr5nez
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

# Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.

---

## How it Works:

1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

---

## Guidelines:

- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.

---

## Example Topics:

1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?

---

Let's help each other grow in our careers and education. Happy discussing! 🌟

/r/Python
https://redd.it/1hrgc7f
Turn your desktop into your todo list

This is my second project ever and I thought I'd make something I wanted personally.

**What my project does:** This little script will take your todo.txt file and make an image out of it. Then it will set it as your background wallpaper image.

This currently only works for Linux, I'm on Mint XFCE, but it should be really easy to configure to work with other distros or os.I included instructions in the readme on how to add an alias to your bash file so you can just run 'todo' in the terminal and have the wallpaper image update after making changes to your txt file.

**Target Audience:** Anyone looking for help being productive. Anyone like me that gets sidetracked easily when trying to keep multiple small tasks in my head during the day.

**Comparison:** I couldn't find anything like this for Linux that fit my needs, so I can't compare to any other programs honestly.

This is simple and silly but I thought I'd share it in case anyone else wanted something like this.

check it out: https://github.com/CHaagFernandez/Desktop-Todo.git

/r/Python
https://redd.it/1hr9bah
Appropriate framework for thesis

Hi everyone!

I'm currently working on my bachelor's thesis in Computer and systems sciences. The focus of my thesis is a comparison of Java and Python in terms of performance and scalability when implementing REST APIs.

For this, I’m using Spring Boot on the Java side. However, I’m unsure which Python framework would be the best equivalent for this comparison. Ideally, it should support REST API development, have a strong community, and be well-suited for performance and scalability testing. So far, I’ve considered Django and Flask, but I’m open to suggestions.

I already know a bit of Flask, but it feels like Flask is a bit too small to offer a fair comparison to Spring Boot.

What do you guys think is the most suitable Python framework to compare with Spring Boot?

/r/Python
https://redd.it/1hrko7z
BLIP CAM: Live Image Captioning - Real-Time Video Stream Description Using AI

Showcase

Hey everyone! I've developed a real-time image captioning system that uses your webcam to generate live descriptions of what it sees. It's powered by BLIP (Bootstrapping Language-Image Pre-training) model, and it overlays the captions right on your video feed in real-time.

What My Project Does: This is a Python application that turns on your webcam and starts describing what it sees in real-time. It uses Salesforce's BLIP model to analyze each frame and generate natural language descriptions. The system shows you the caption, frame rate, and even GPU usage right on the screen. You can save frames with their captions, pause the description whenever you want, and it's all optimized to run smoothly on your computer.

Target Audience: This project is perfect for:

Developers working on accessibility tools for visually impaired users
Anyone interested in computer vision and natural language processing
People building smart security systems or educational tools
Developers looking to add automated scene description to their applications

Technical Details: The system uses a multi-threaded architecture to handle video streaming and caption generation separately, ensuring smooth performance. It supports GPU acceleration if you have an NVIDIA card, and you can easily configure things like resolution and caption update frequency. All the core

/r/Python
https://redd.it/1hrnv69
Ask Reddit: Has anyone used the Frappe Framework?

Hey everyone.

I normally use Django / FastAPI but recently came across Frappe Framework and it seems like a nice way to build internal apps, although it's quite opinionated.

Was just wondering if anyone has any tales operating Frappe apps (outside of ERPNext context)?

/r/Python
https://redd.it/1hrq8qn
D Monthly Who's Hiring and Who wants to be Hired?

For Job Postings please use this template

>Hiring: [Location\], Salary:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] and [Brief overview, what you're looking for\]

For Those looking for jobs please use this template

>Want to be Hired: [Location\], Salary Expectation:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] Resume: [Link to resume\] and [Brief overview, what you're looking for\]

​

Please remember that this community is geared towards those with experience.

/r/MachineLearning
https://redd.it/1hq5o1z
I tried to compare FastAPI and Django

Hi there, I’ve written a blog post comparing FastAPI and Django. It’s not about starting a fight, just providing points to help you choose the right one for your next project.

Hope you find it helpful!

/r/django
https://redd.it/1hrs2c3
Calling APscheduler during flask initiation

Hi Everyone,

I am using apscheduler inside my flask application.

Note: I am not using Flask\-APScheduler(flask extension). I am using its standalone library(pip install APScheduler)

========Let me give the context of my application ======================

i am starting my scheduler in create_app() function in application/__init__.py file. My code looks something like this

inside statusPollingScheduler.py file
def getStatusUpdatePollingScheduler():
   
    executors={
        'default':ThreadPoolExecutor(1)
    }
   
    scheduler = BackgroundScheduler(executors=executors)
    scheduler.addjob(
        controllerThread,
        'interval',
        seconds=15,
        max
instances=1,  
        coalesce=True,
        args=(60,) #(timeout,)
    )
   
    return scheduler

inside application/init.py file

def startPollingScheduler():
    from .statusPollingScheduler import getStatusUpdatePollingScheduler
   

/r/flask
https://redd.it/1hrrvib
A library for multi-objective community detection

Hello everyone, I've been working on a project for about three months to create an evolutionary algorithm for detecting communities in graphs (as in the example on the link below). I first chose Rust because of its speed, but I ended up exporting it to Python because I didn't see any implementation of this specific tool and I thought it would be interesting to contribute to this project.

My project tries to find communities in graphs using a function that maximizes internal links and minimizes external ones, different from algorithms like Leiden or Louvain that have only one objective function, the target audience is the data science community.

Well, I'm here sharing the library (it's in beta, has some debug prints and is far from being optimized for the Python GIL environment). However, I would like suggestions for what I can improve before releasing a stable version.Lib: https://github.com/0l1ve1r4/re-mocd

/r/Python
https://redd.it/1hrzj5e
Help with secretkey

I know I have to set the secret\
key using environment variables. I know how to do it. The only problem is that if I were to host my web application on a server, os.environ.get(variable) will no longer know where the variable is present locally on my machine.
Maybe I'm taking the wrong approach or do I need to create some sort of connection from the server to my PC? (although this way I would have to leave it on all the time, and it wouldn't make sense).

/r/flask
https://redd.it/1hrazdo
How to calculate the resources used by my entire django project

I want to know a way to calculate the resources (cpu and ram) my django project uses; I need that information to know the infrastructure requirements of the server where I will deploy.

/r/django
https://redd.it/1hs8usz
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/1hs8l05
Model vs AbstractUser vs AbstractBaseUser

I'm building a web app that deals with the usual CRUD. A user should be able to sign in, it's data stored in posgresql, and perform login with email and passoword, afterwards. Also, there would be foreign keys as expected and the user might be able to upload files such as images, csv tables and other forms of data science information.

Creating a class model with models.Model is more common, so finding examples and bug soutions are easy. But at same time, people advise against it for new projects, especially with different auth methods (such as using email instead of username for login).

So basically AbstractBaseUser gives more freedom, but it's more complex and easier to make mistakes. And so I'll get much more bugs than now.

Finally, AbstractUser \~\~ Model, I guess. Wich option would be more appropriate and simple to use to build a website as above?

/r/django
https://redd.it/1hs7wzb
Question about folder structure!

Hello everyone, how are you?

What is the best approach to a folder structure in a Django project?

The project will grow gradually and I would like a concise structure that allows for this growth, while not being a mess and making it easy for other people to start coding in this structure if necessary.

The project will be a system for schools, with two "fronts", basically a class management system, where teachers will be able to publish classes. There are more things regarding the application, but this is its core.

This would be the first "front", the second "front" is the part of the students, who will enter the portal and be able to see these classes.

I'm using Django as FullStack, with Templates and using Bootstrap for styling, PostgreSQL as database.

Could anyone tell me a good folder structure for a project like this that will grow?

Cheers!

/r/django
https://redd.it/1hs30it
How to make Django Manager and Model's interactions follow the Open/Closed Principle?

I am designing models for my Django App and am concerned with decoupling the caller's logic from the model's implementation, so that future changes to the model itself do not require changes downstream in the codebase. In short adhering to the Open/Closed Principle (OCP).

I am wondering what is a best practice to implement this while leveraging Django's framework best.

Conceptually, I believe it would make sense to do the following:

from django.db import models

class FooManager(models.Manager):
def is_active(self):
return self.filter(is_active=True)

class Foo(models.Model):
_bar = models.CharField(max_length=100, db_column="bar")
is_active = models.BooleanField(default=True)

objects = FooManager()

@property
def bar(self):
return self._bar

@bar.setter
def bar(self, value):
if not self._bar:
self._bar = value
else:
#some setter logic
pass


1. Custom Manager

/r/django
https://redd.it/1hsh1rz
Discussion How is LLM changing your job as a ML engineer

I just watched Andrew Ng’s talk on AI agents. He talked about how traditional ML tasks could take 6 months but now it only needs a weekend with LLMs.

It’s at 2-4mins into this talk. https://youtu.be/KrRD7r7y7NY?si=XDCAm7NFTMO3ayn3

Specifically, I guess he’s saying you can do zero shot learning with LLMs instead of gathering large amounts of labelled data, build and deploy a model. He used the example of sentiment analysis tasks.

I wonder if any one is experiencing this shift in productivity at work as a ML scientist.

My experience is companies don’t want to use chatGPT directly and try to build their own in house LLMs, I guess for data privacy and cost concerns.

Please share your experience.

/r/MachineLearning
https://redd.it/1hs41pt