pythondaily | Education

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Subscribe to a channel

Python Daily

Deploy Your AI Chatbot for FREE with PythonAnywhere! (Step-by-Step Tutorial)

Hey everyone,

If you've built an AI chatbot or any other application with Python but don’t know how to deploy it online, I just released a step-by-step tutorial showing how to do it **for free** using PythonAnywhere.

In the video, I cover:

* Setting up a PythonAnywhere account
* Uploading and running your chatbot on a live server
* Host a Flask web app for your AI chatbot
* Get a public URL to share your chatbot with the world
* Works for chatbots, knowledge bases, and automation scripts

This is perfect if you want to share your chatbot or application with others without paying for hosting.

**Check it out** [YouTube](https://youtu.be/7NtSuPsVcg4)

Would love to hear your thoughts! Have you deployed any AI projects before?

/r/flask
https://redd.it/1jpy1rm

Читать полностью…

Python Daily

Migrate doesn't detect changes to default values?

According to GPT this is an expected behaviour of Flask. Alembic only detects schema-related changes (column add/remove, renaming...) but doesn't detect for instance if I change a columns default value from NULL to 0. Is this correct?

/r/flask
https://redd.it/1jrebzs

Читать полностью…

Python Daily

D ICML 2025 - what if reviewers don't acknowledge rebuttal?

2 out of my 5 reviewers at ICML didn't acknowledge my rebuttal at all. Not only no answer, they also didn't even click the "acknowledge rebuttal" at all. According to ICML rules, they are required to do that. What happens when they don't? Should we report this to AC? I didn't find this anywhere, so maybe someone here knows or is in a similar situation.

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

Читать полностью…

Python Daily

Simple REST endpoint with mutliple databases using the same model.

I have a small flask app(learning it AND python) that currently has a single hard coded database. Something LIKE this(not the actual code but semi close)

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI] = 'mysql://user:pass@servername/dbname'
db=SQLAlchemy

class User(db.Model):
__tablename__='someuserstable'
userid = db.Column(db.String(100), primary_key=True)
username = db.Column(db.String(100), nullable=False)

def getjson(self):
return {'userid': self.userid, 'username': self.username}

app.route('/users', methods=['GET']
def get_users():
users = User.query.paginate(page=0, per_page=10)
return jsonify(user.getjson) for user in users

But what I am trying to figure out is how to have it pick the correct connection based on an input on the route. Essentially, I need a map of database connections with. Again, this is more psuedo code and what I am trying to figure out as each connnection will have the same table(s) but different server/username/password/database names(maybe not sure of

/r/flask
https://redd.it/1jrlw4n

Читать полностью…

Python Daily

Getting same response for "invalid credentials" and "inactive user" using djoser + simpleJWT + Drf

Hey everyone
I'm using Django with Djoser + simple jwt for auth, everything works fine but the endpoints /api/auth/jwt/create return the same response "No active account found with the given credentials" for both when a user enters a wrong email or password and if a user account is not active yet i.e they haven't verified their email. It shows the same error message
I understand it's like a security measure, but it's making it hard for the front end to print the right error message to the user. I have tried customising the TokenCreateSerializer. But it doesn't have an effect on the JWT endpoints. Is there anyone that has experience with this?

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

Читать полностью…

Python Daily

Showcase A tarot reading app built in Python with Flask, SQL, and OpenAI — each reading is dynamic

What My Project Does
I built a pixel-art tarot app/game called Mama Nyah’s House of Tarot, where each reading is personalized, story-driven, and dynamically generated based on the user’s intention and cards drawn. Users enter an intention, pull three cards (past, present, future), and the app returns a poetic interpretation written by the OpenAI API.

The experience is meant to feel like stepping into a mystical little tarot parlor in New Orleans.

Target Audience
The project is built for people interested in tarot, storytelling, and immersive digital experiences. While not a full "game," it’s meant to offer a cozy, atmospheric escape or introspection tool. It’s available on Steam, but also served as a learning exercise for me to integrate a Flask backend, persistent user data, and API-driven storytelling.

How It Works / Stack

Python Arcade for game logic and UI
Python + Flask for the backend logic
Render to deploy the app, hold a token limiter, and store reading data
SQL to store user sessions and reading metadata
OpenAI API to generate fresh interpretations based on card combinations and intentions
Aseprite for creating all the pixel art assets

Comparison to Existing Alternatives
Most tarot apps use static card definitions or canned

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

Читать полностью…

Python Daily

Python Application for Stock Market Investing


https://github.com/natstar99/BNB-Portfolio-Manager
What My Project Does
This project is a stock market portfolio management tool. Its works in every country and for every currency. Feel free to test it out for yourself or contribute to the project!

Target Audience
The project is aimed at anyone who is interested in managing their portfolios locally on their computers. Currently, it only works for windows computers

Comparison
This project is unique because its completely open sourced

(https://github.com/natstar99/BNB-Portfolio-Manager)



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

Читать полностью…

Python Daily

How many SQL queries per request is too many when each includes SELECT, INSERT, and UPDATE?

I'm handling a backend where every API request triggers about 3–5 SQL queries a mix ofSELECT,INSERT, and UPDATE. These queries operate on individual objects and can't be batched, merged, or prefetched because each one serves a distinct purpose.

Is there a general rule of thumb on how many DB hits per request is too many before it becomes a performance concern?

/r/djangolearning
https://redd.it/1jrcv1t

Читать полностью…

Python Daily

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 title.

\--

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/1jpdo7y

Читать полностью…

Python Daily

Isn't it's hilarious that Guido van Rossum has a brother named Just van Rossum?

Like, there's a famous software engineer Guido van Rossum. He also has a brother who's not a software engineer and not Guido. He's just van Rossum. Like, your regular, run-of-the-mill van Rossum.

Sorry, I don't know if this gag has ever emerged among you Python folks.

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

Читать полностью…

Python Daily

How to start in Django

Hey guys, I am new to python and want to learn django but don't know where to start and how to start. Whether I should watch YouTube or Docs.

I am totally confused can you guys suggest me what should I do.

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

Читать полностью…

Python Daily

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/1jqyaw2

Читать полностью…

Python Daily

yt-stats-wrangler - I Created a Python Package for collecting data from YouTube API V3

**What my project does:**

Hey everyone! I work with social media analytics and found myself sourcing data with YouTube API V3 quite often. After looking around for existing wrappers, I thought it would be a fun idea to make my own and deploy it as an open-source package.

So I'm introducing the **yt-stats-wrangler**, which is now available with a simple pip install (see install instructions on links below). Using a google developer key, the package quickly allows you to gather data from the YouTube Data API V3, and then output them into a specified format of your choice. This includes public data and stats on channels, videos and comments.

My goals were as follows:

* Create a modular package that can collect public YouTube data in a logical workflow
* Gather Channels -> Gather videos on channels -> Gather stats for videos -> Gather comments on videos
* Keep the package lightweight and avoid unnecessary dependencies, but offer optional integration of popular data libraries (pandas, polars) for ease of use

This is the first python package that I have ever released. I would love any feedback whether it be in technical implementation, or organizational/documentation structure. I've also attached an MIT license to the

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

Читать полностью…

Python Daily

Django Admin Unfold

Hi guys, do any of you know how to configure admin ui of unfold to handle custom user auth/class? When I use the code below, I can't logged in on the admin dashboard the user I've just created using my superuser. below is the code to use unfold on user class.

@admin.register(User)
class UserAdmin(BaseUserAdmin, ModelAdmin):
# Forms loaded from `unfold.forms`
form = UserChangeForm
add_form = UserCreationForm
change_password_form = AdminPasswordChangeForm

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

Читать полностью…

Python Daily

Flask migration for SQL

Hi, I'm deploying a Flask app with an SQL database and Flask migration in production for the first time. The app works locally, and I have a folder containing migration scripts. I'm unsure about the next steps, particularly whether I should push the migration folder to Git. Can someone with experience in database migrations please guide me?

/r/flask
https://redd.it/1jqknfr

Читать полностью…

Python Daily

what are flask apis and docker primarily used for



/r/flask
https://redd.it/1jrdr5z

Читать полностью…

Python Daily

[R] Novel Logic-Enhanced LLM for Improved Symbolic Reasoning
https://marqcodes.com/logicEnhanced.html

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

Читать полностью…

Python Daily

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/1jrqh32

Читать полностью…

Python Daily

Deploying Containerized Apps to Remote Server Help/Advice (Django, VueJS)

I posted this in r/docker but since it's Django specific I wanted to ask the community here to for help. I have a Django and VueJS app that I've converted into a containerized docker app which also uses docker compose. I have a digitalocean droplet (remote ubuntu server) stood up and I'm ready to deploy this thing. But how do you guys deploy docker apps? Before this was containerized, the way I deployed this app was via a custom ci/cd shell script via ssh I created that does the following:

* Pushes code changes up to git repo for source control
* Builds app and packages the source code
* Stops web servers on the remote server (Gunicorn and nginx)
* Makes a backup of the current site
* Pushes the new site files to the server
* Restarts the web servers (Gunicorn and nginx)
* Done

But what needs to change now that this app is containerized? Can I just simply add a step to restart or rebuild the docker images, if so which one: restart or rebuild and why? What's up with docker registries and image tags? When/how do I use those, and do I even need to?

Apologize in advance if these are monotonous questions but

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

Читать полностью…

Python Daily

Django 5.2 tip composite primary keys

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

Читать полностью…

Python Daily

Compress-py: A CLI to compress files with multiple algorithms

Hello there!

For some time now I've been working on a CLI that offers multiple algorithms to compress and decompress files, and I wanted to share it with you! Here is the Github repository



## What My Project Does:
Tl;DR: You compress stuff with it:
I have implemented Huffman Coding LZW, and RLE without any external compression library. Apart from those compression algorithms, I also implemented the Burrows-Wheeler Transform and Move-To-Front transform to increase compression efficiency.


My project allows you to combine these transformations with the main compression algorithm. If you're not sure which one to choose, I offer a compare-all command, which tests every compression algorithm on a file and provides useful information which will help you choose an algorithm.

Please read the README if you are curious about my implementation, I tried to articulate my choices as much as possible.

## Target Audience:
This was more of a toy project, and is certainly not supposed to be considered 'Production Level'. I wanted to immerse myself in the world of data compression, while refining my python skills.

With that being said, I think I achieved pretty good results, and anyone who wishes to take it for a spin for not-so-serious intentions is welcome.

## Comparison:
I didn't really compare

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

Читать полностью…

Python Daily

Recommended way to manage several installed versions of Python (macOS)

When I use VS Code and select a version of Python on macOS, I have the following versions:

* Python 3.12.8 ('3.12.8') \~/.pyenv/versions/3.12.8/bin/python
* Python 3.13.2 /opt/homebrew/bin/python
* Python 3.12.8 /usr/local/bin/python3
* Python 3.9.6 /Library/Developer/CommandLineTools/usr/bin/python3
* Python 3.9.6 /usr/bin/python3

I believe having this many versions of Python in different locations messes me up when trying to install packages (i.e. using brew vs pip3 vs pyenv), so I'm wondering what the best way is to clean this up and make package + version management easier?

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

Читать полностью…

Python Daily

I am learning Django and looking for open source project to read it's code and learn from it.

Is there any open source project based on Django so that one can clone and see the code just to learn how certain things are done? I am looking not just any project found in GitHub, I am looking for some good examples of Python/Django code, project organization and solutions to certain problems (like implementing MFA, extension of standard Django classes and etc.)

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

Читать полностью…

Python Daily

Project - StegH

I'd like to showcase a project I’ve been working on recently.

It’s an image steganography tool that allows you to hide messages inside images securely.

Key features of the tool include:

* **Encrypt & Hide Messages**: Securely hide secret messages inside image files using AES encryption.
* **Platform (Currently Windows-only)**: Right now, it’s available as an executable for Windows.
* **No external dependencies**: Pure Python with minimal libraries such as Pillow, NumPy, and pycryptodome.

**What my project does:** It enables users to securely encrypt and hide messages within images, allowing for private communication. The tool uses AES encryption to ensure the confidentiality of the embedded messages.

**Target audience:** This tool is intended for anyone interested in privacy, security, and steganography, especially developers and enthusiasts exploring encryption techniques.

**Comparison:** This tool isn’t just about encryption; it’s focused on embedding messages into images, which can be shared inconspicuously.

**One last thing:** Quick tip: When sharing an image with a hidden message, be sure to send it as a document (e.g., via WhatsApp's document sharing option). Sending it as a regular image might lead to compression, which could corrupt the hidden data.

Here’s the link to the GitHub repository: [Github](https://github.com/Soham-04/STEGH)

Would love to hear any feedback or thoughts on it!

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

Читать полностью…

Python Daily

🚨 Testing Phase – Update 3 ( www.saketmanolkar.me )

https://redd.it/1jqztpo
@pythondaily

Читать полностью…

Python Daily

Staticfiles on production server

So I’m trying to deploy my app to my server and is working except it looks ugly (no css, guess no js, etc) I’m ruining my app inside docker and an extra container with nginx. I setup a subdomain for my api and all works well. The api/docs documentation looks fine but the admin pages miss css,etc. I guess I need to hable staticfiles and add it to nginx but what is the way to go regarding this for production environment? Any tips will help. Many thanks

/r/djangolearning
https://redd.it/1jqwex1

Читать полностью…

Python Daily

Do you use FastAPI on production?

I've read that FastAPI is used by some big companies, which by themselves have a lot of money and some of the best developers in the world. But down here on earth of poor people, are you (single dev or small company) using FastAPI on production?
It seems like FastAPI is largely developed and maintained by one person (Tiangolo). While he’s done an incredible job, this raises concerns about the project's long-term sustainability. With such a large user base, it’s surprising that there isn’t a bigger core team maintaining it. If Tiangolo were to step away, what happens to FastAPI?
It’s one of the most popular async-first frameworks, but relying on it in production sometimes feels like standing on shifting ground.
I’d love to hear from others working with FastAPI on production.

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

Читать полностью…

Python Daily

I wrote on post on why you should start using polars in 2025 based on personal experiences

There has been some discussions about pandas and polars on and off, I have been working in data analytics and machine learning for 8 years, most of the times I've been using python and pandas.

After trying polars in last year, I strongly suggest you to use polars in your next analytical projects, this post explains why.

tldr:
1. faster performance
2. no inplace=true and reset_index
3. better type system

I'm still very new to writing such technical post, English is also not my native language, please let me know if and how you think the content/tone/writing can be improved.

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

Читать полностью…

Python Daily

Easily share Python scripts with dependencies (uv + PEP 723)

Sharing single-file Python scripts with external dependencies can be challenging, especially when sharing with people who are less familiar with Python. I wrote a article that made the front page of HN last week on how to use uv and PEP 723 to embed external deps directly into scripts and accomplish the goal.

No more directly messing with virtual environments, requirements.txt, etc. for simple scripts. Perfect for sharing quick tools and utilities. uv rocks! Check it out here.

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

Читать полностью…

Python Daily

New to flask and MySQL help needed

/r/flask
https://redd.it/1jq4kvx

Читать полностью…
Subscribe to a channel