pythondaily | Образование

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

Подписаться на канал

Python Daily

Please help ASAP ngrok issues

i am having this issue always and now its not even working just showing up this,"Your ngrok-agent version "2.3.41" is too old. The minimum supported agent version for your account is "3.2.0". Please update to a newer version with `ngrok update`, by downloading from https://ngrok.com/download, or by updating your SDK version. Paid accounts are currently excluded from minimum agent version requirements. To begin handling traffic immediately without updating your agent, upgrade to a paid plan: https://dashboard.ngrok.com/billing/subscription."

what should i do i tried with ngrok update but it told me ngrok is running the latest update

please help

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

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

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

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

Python Daily

YTMASC, take your YouTube music library to anywhere!

GitHub

I've been developing this tool for quite a while now, but was hesitant to share it because I had many things in mind to implement. However I'd like to share the project as about half of the stuff is in there and functional.

# What My Project Does

YTMASC gets your library by:

Scraping your YouTube library page (yes I know this is a horrible way of doing it but it's the easiest, I've something else in mind don't worry but it'll be the least of my priorities :D)
Imports RiMusic databases (also ViMusic since the fork didn't change the database schema)
A CSV file of your own that has 3 columns (\watch_id, artist, title)

And puts data from these sources into a simple json file. The information here is later used at the tasks you want to run.

Also, there are some tools to help you fix any issues you may run into (YouTube making the video unavailable, migration of old libraries etc.)

It's mainly available as CLI with a config file you can tinker with, I had written a tkinter GUI before but I don't want to maintain it anymore due to it being well, unmaintainable because I didn't think I'd be developing

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

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

Python Daily

A pytest plugin to run async tests 'concurrently'

**What My Project Does**

System/Integration tests sometimes can take really long time, due to spending huge amount of time waiting for external services responding. Pytest-asyncio make async tests testable, but run them sequentially. Pytest-xdist spinup multiple processes, blew up our fragile server during tests collection :(

* This plugin is to solve this by running asynchronous tests in true parallel, enabling faster execution for high I/O or network-bound test suites.
* Also give you high flexibility to specify tests that can run in parallel.
* Compatibility with Pytest-asyncio if you are already deep in rabbit hole.

**Target Audience**

The plugin is mainly targeted system/Integration tests, which is heavily bounded by I/O, network or other external dependency.

This plugin would more or less Break Test Isolation Principle. So make sure your tests is ok to run concurrently before you use this plugin.

**Comparison**

As mentioned above, unlike `pytest-asyncio`, which runs async tests sequentially, `pytest-asyncio-concurrent` takes advantage of Python's asyncio capabilities to execute tests concurrently by specifying async group.

**Try this out!**

Welcome to try this out, and let me know your feedback!

Github link: [https://github.com/czl9707/pytest-asyncio-concurrent](https://github.com/czl9707/pytest-asyncio-concurrent)
PyPI: `pip install pytest-asyncio-concurrent`

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

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

Python Daily

Authentication state management reactnative django

so i am a nub, and this is my first project i've created login page and signup and used drf to connect, everything works fine and when i create user and login then i've placed welcome,firstname. now i want to make my app acessible after login and i found out i've to learn autentication state but when searching i can't find any docs or proper tutorial related to the stuff. so plz help guys any docs or tutorial.

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

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

Python Daily

Would it be possible to host a django backend on an Android device?

Also, would it be possible for that backend to access sqlite on said Android device?

Thanks.

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

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

Python Daily

After changing flask port, port 5000 is not working anymore

Hey, I was sending API request to my flask application at 192.168.X.X:5000 from my local network for last few days.
Today I asked my friend to try and send API request , because I was in a hurry, I didn't have time to open new ports and I remembered I had port 25565 already opened so I used that one (so it was pub-ip:25565).

Now that I have time, I opened port 5000 and now the script is not working when I go back to port 5000.
I tried again with 25565 and its working, I tried from port 12345 and its working. Just the 5000 is NOT working.
Any suggestions?

When I start the app:

Serving Flask app 'main'
Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
Running on http://192.168.X.X:5000
Press CTRL+C to quit
Restarting with stat
Debugger is active!
Debugger PIN: 233-951-201

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

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

Python Daily

Where to start with headless allauth

Hey everyone!

I've been taking my first steps into front end development, I've chosen sveltekit and am loving it so far. Now for the tricky part, authentication. There is a boilerplate project for allauth in react but I find the documentation to be lacking any guidance on implementation, any pointers?

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

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

Python Daily

How to effectively understand the Django repository (or any large codebase)?

The reason I am asking this question stems from my exploration of the Django codebase, which began after I finished studying Django for Beginners 4.2 by Will Vincent. Throughout the book, I often found myself asking questions like, how do CBVs and GCBVs work? Why do they inherit from the View class? Why is .as_view() used with CBVs and GCBVs, but not with FBVs?

These questions stayed in my mind, so I decided to explore the Django repository to understand them better. While most of the code (if not all) went over my head, I believe I now partially "understand" the "why" behind some of these concepts.

From my exploration, I realized that as_view() essentially “converts” CBVs and GCBVs into functions because the foundational way of building Django views are FBVs. CBVs and GCBVs are built on top of FBVs. CBVs aim to achieve better separation of logic by mapping HTTP methods to specific class methods, while GCBVs are built on top of CBVs to simplify common tasks like creating, updating, deleting, querying and displaying data e.c.t.

I am not entirely sure if my understanding is accurate, but this is how I have interpreted it so far.

My question is, How can I understand

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

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

Python Daily

Advanced Tutorials

The Djangoverse is not lacking in any beginner tutorials. Although some cover more advanced topics, they are harder to find and some topics have none.

I've been following some more advanced tutorials on structuring Django projects and it really advanced my understanding of the framework. I thought it would be great if people could post tutorials they've found useful on some of the more advanced/obscure topics (not covered in the beginner tutorials). Some of my topics of interest (feel free to add yours!):

1. Email verification for custom user models (tokens anyone?):
2. Full email system setup in general:
3. Celery use beyond just setup:
4. How to manage changes and migrations while website is deployed already:

I'm sure there are a lot more. It would be great to have an ongoing list.

Best wishes for 2025!

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

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

Python Daily

Relative Date DSL similar to Grafanas Date Picker shortcuts

**What My Project Does:**

It allows for defining relative Date-Times using a human friendly syntax which is great for configuration files.

A basic example to get the first saturday of the current month:

/month -1 day /sat + 1 week

Here is another example that gets every 3rd calendar week;

%cw 3

It has more features:

* Validation via [pre commit hook](https://iilei.github.io/cronspell/details/pre_commit_hook/)
* Accessible via [command line interface](https://iilei.github.io/cronspell/details/cli/)
* Determine upcoming moments -- see [example test cases](https://github.com/iilei/cronspell/blob/master/tests/test_upcoming.py)

**Target Audience:**

With its focus on intuitive comprehensibility, I hope to offer value for a variety of roles such as

* Developers
* Data-Engineers
* Technical Writers
* Business Engineers

**Comparison:**

A different python package, `crontab` embodies the de-facto standard domain-specific-language to express repeating date-times in a reliable fashion. The Syntax is powerful and well-established. The properties of both exhibit some overlap but are not identical.

**License:**

MIT License

More Details at the [project documentation GitHub pages](https://iilei.github.io/cronspell/details/recipes/).
Would love to hear your thoughts and suggestions for improvements!






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

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

Python Daily

Constructors: init, new, both, neither?

Hi all, I'm doing some research on what programmers believe is the class constructor in Python. I made a poll here: https://strawpoll.com/05ZdzVzdmn6 and would appreciate all responses, thanks!



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

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

Python Daily

Zero-knowledge encryption in Django

Hello,

I built a web app (rn local only) for professional (job/work related) purposes to help my friend as a marketer/ writer (he writes for different companies and manages that stuff on his laptop as a local machine). Now some of his friends want to try it out, and it will be too much work to help them run in their local server with a virtual environment. I also want to try and scale it out if it works.

I have another simple project in Django that helps manage funding, source of funding, etc., and other personal user data.


Now the issue is I want to make sure I as a super admin or admin, or the server owner (or as a developer) don't have access to any of the writings or work they have saved in that system or server.

How can I achieve that in Django?

I was thinking of using their username (only one username for each user) to generate a mnemonic for that user and encrypt and decrypt their data when they log in and access.

I do not know how blockchain works and I am a mid-level Django

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

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

Python Daily

Welcome to our new Django accessibility team members - Eli, Marijke, Saptak, Tushar
https://www.djangoproject.com/weblog/2024/dec/24/welcome-new-django-accessibility-team-members/

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

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

Python Daily

where to revise python to start learning ai

i learned python 6 years ago and i want place where i can revise and start learning about ai after, i totally forgot python syntax but ive been programming using c/c++ for embedded systems. i need it free and fast paced

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

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

Python Daily

Spotify Scheduler - Easily schedule your Spotify playlists to play at a specific time!

What My Project Does
Spotify Scheduler is an app that lets you schedule Spotify playlists to play at specific time (hours, minutes and seconds) (e.g. 8:00-8:15:30). You can use it to automate your listening experience and customize playback times according to your preferences. You can select different playlist for each time slot.

Target Audience
It's ideal for PA systems, school, or just automating music playback at home.

Comparison
I couldn't find any alternatives, so i did this app. The reasonable alternatives are radio automation softwares, but my app is much easier to use.

Github repository: https://github.com/sandrzejewskipl/spotify-scheduler

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

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

Python Daily

🌀 Interstice: The Zero-Player Game Simulator

PyPI | Website | GitHub

Hey r/Python!

I’m excited to introduce Interstice, a zero-player game simulator that explores emergent behavior on a 2D grid. This Python package brings to life complex systems where entities evolve according to simple rules perfect for those curious about simulation, artificial intelligence, and game theory.

# What My Project Does

Interstice is a zero-player game, meaning there’s no user input once the game begins. The simulation evolves autonomously based on pre-defined rules:

Entities: Different "agents" (like Demons and Soldiers) interact on a grid.
Interactions: These agents follow unique behaviors that create emergent patterns.
Visualization: See the grid evolve in real-time through a webpage.

This game lets you experiment with different rules, initial states, and grids to discover the fascinating results of these interactions.

# Target Audience

A fan of games like Conway's Game of Life or Langton's Ant,
Curious about emergent behavior in autonomous systems,
Interested in creating interactive simulations for fun or research

# Comparison

Interactive: Modify rules and observe changes on the fly.
Python-first: Built with Python developers in mind, making it easy to extend.
Creative: Design unique simulations that explore autonomous systems.

# Check it Out

PyPI Package: Install with pip install interstice
Website: [bananajump.com/interstice](https://bananajump.com/interstice)
GitHub Repository: https://github.com/interstice-stack/interstice

# 🏆 Win

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

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

Python Daily

I am using react for front end should I skip going deep about views and templates?

I am learning django, using the docs and django books written by william. My question is should skip learning too deep about templates and such that are used for creating ui and focus on only backend and jump straight to django for apis book?

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

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

Python Daily

A lightweight Python wrapper for the Strava API that makes authentication painless


**What My Project Does**

Light Strava Client is a minimalist Python wrapper around the Strava API that automates the entire OAuth flow and token management. It provides a clean, typed interface for accessing Strava data while handling all the authentication complexity behind the scenes.
Key features:

* Automated OAuth flow (just paste the callback URL and you're done)
* Automatic token refresh handling
* Type-safe responses using Pydantic
* Simple to extend with new endpoints
* No complex dependencies

**Target Audience**

This is primarily designed for developers who want to quickly prototype or build personal projects with Strava data. While it can be used in production, it's intentionally kept minimal to prioritize hackability and ease of understanding over comprehensive feature coverage.

**Comparison**

The main alternative is stravalib, which is a mature and feature-complete library. Light Strava Client takes a different approach by offering a minimal, modern (Pydantic, type hints) codebase that prioritizes quick setup and hackability over comprehensive features.

The code is available here: [https://github.com/GiovanniGiacometti/Light-Strava-Client](https://github.com/GiovanniGiacometti/Light-Strava-Client)

I'd love to hear your thoughts or feature suggestions!

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

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

Python Daily

D Everyone is so into LLMs but can the transformer architecture be used to improve more ‘traditional’ fields of machine learning


i’m thinking things like recommendation algorithms, ones that rely on unsupervised learning or many other unsupervised algos

i’ll look more into it but wanted to maybe get some thoughts on it

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

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

Python Daily

Affordable and Reliable Hosting for Django Project with PostgreSQL, Redis, and AWS S3?

I'm developing a Django project which includes several key modules:

AI Integration: Uses OpenAI to provide crop recommendations and chatbot features.
Weather Module: Incorporates weather data to assist with planning and insights.
Mapping Tools: Utilizes Mapbox for GIS-related functionalities, like visualizing field and crop data.
User Management: Manages user accounts, authentication and auth.

The app requires PostgreSQL for the database, Redis for caching, and AWS S3 for media and static files. I’m looking for a hosting platform that is both affordable and highly reliable for these requirements. Any recommendations?

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

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

Python Daily

🐍 Modern, Minimalistic and Scalable Python FastAPI Template🚀

Hey! 👋 Excited to share my production-ready API template that shows off modern Python practices and tooling! ✨



Key highlights: 🌟

\- ⚡️ Async-first with FastAPI and SQLAlchemy

\- 🏗️ Clean, maintainable architecture (repository pattern)

\- 🛠️ Latest Python tooling (UV package manager)

\- 🧪 Automated testing and CI pipeline

\- 🚂 One-click deployment to Railway



The template implements a fun superhero API to showcase real-world patterns! 🦸‍♂️



Technical goodies: 🔧

\- ✅ Type hints throughout

\- 🔄 Pydantic v2 for validation

\- 📖 Automatic OpenAPI docs

\- ⚠️ Proper error handling

\- 🔄 Async database operations

\- ⚡️ Automated migrations



GitHub: https://github.com/luchog01/minimalistic-fastapi-template 🌟



The logging setup and database migration patterns were super tricky to figure out 😅 Not 100% sure if I handled them in the best way possible! Would really appreciate any feedback from the Python experts here! 🙏 Always excited to learn from the community!

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

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

Python Daily

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

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

Python Daily

I have A question about my code in python

The code should make 100km

then subtract from it 100 meter

then 100cm then

then 100 mm

then Evaluate Exactly the value

THat is The file Which I wrote the correct Code

import Methods as M
def Convert_To_Decimal(Value):
    for i in range(len(Distance_List)-1):
        # Convert To Decimal
        V = Convert_Distance(Distance_List[i], Distance_List[i+1], Value)
       
        if V!=0:
            print(V, Distance_List[i+1], end=" ")  
        V=V-int(V)
    print()
        # Print Number
       
def Convert_Distance(From, To="1km", Value=0):
   
    return round(Value * M.Return_distance(From) / M.Return_distance(To),10)

def Minus():
    B = 100
    for Label in Distance_List[1:]:
        print("Subtracting 100", Label)
   

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

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

Python Daily

Tips for Learning Django.. coming from Java (Spring)?

Hello guys, I'm moving from a team using Java (Spring) to a Django backend team (likely using the Django REST framework) within my company after the New Year break. I've never worked with Django before, but I do know Python pretty well since it’s my go to language for LC. My current plan is to start with the official Django tutorial, move on to Django REST doc, and then build a small project to get some hands on experience.

For those who know both Spring and Django, is there anything I should keep in mind while learning Django? (I also have some experience with nodeJs Express, though that was from some personal projects I worked on a long time ago) Also, is the official Django doc the best way to learn, or are there other resources you’d recommend? Would love to hear any advice or tips from people who’ve been in a similar boat. Thanks!

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

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

Python Daily

Python package ideas.

hii...
i wanna create a unique useful python package for my next project.

and i am outof ideas. can you please let me know you opinions and ideas about that.
i mean, is there anything that you thought like if this kinda package exists, that would be great, i wanna hear that....
(i like cryptography, iot, microcontroller stuffs aswell)
thank uuuuuuu....

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

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

Python Daily

Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

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

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

Python Daily

Puppy: best friend for your 2025 python projects

TLDR: https://github.com/liquidcarbon/puppy helps you install and manage python projects, environments, and notebook kernels.

# What My Project Does

\- installs python and dependencies, in complete isolation from any existing python on your system
\- `pup add myenv pkg1 pkg2` uses uv to handle projects, packages and virtual environments; `pup list` shows what's already installed
\- `pup clone` and `pup sync` help build environments from external repos with `pyproject.toml` files
\- `import pup; pup.fetch("myenv")`  for reproducible, future-proof scripts and notebooks


Puppy works the same on Windows, Mac, Linux (tested with GitHub actions).

Get started (mix and match installer's query params to suit your needs):

curl -fsSL "https://pup-py-fetch.hf.space?python=3.12&pixi=jupyter&env1=duckdb,pandas" | bash

# Target Audience

Loosely defining 2 personas:

1. Getting Started with Python (or herding folks who are):
1. puppy is the easiest way to go from 0 to modern python - one-command installer that lets you specify python version, venvs to build, repos to clone - getting everyone from 0 to 1 in an easy and standardized way
2. if you're confused about virtual environments and notebook kernels, check out pup.fetch that lets you build and activate environments from jupyter or any other interactive shell
2. Competent - check out Multi-Puppy-Verse and Where

/r/Python
[
https://redd.it/1hllr3j

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

Python Daily

Looking for Feedback on My Portfolio

Hey everyone,

I’ve been putting together my portfolio as a junior developer and would love to get some feedback. I’m aiming to land a junior web developer role, ideally as a back-end developer.

Here’s the link to my portfolio: https://andersonportfolio.pythonanywhere.com/

Feel free to point out anything—whether it’s about structure, best practices, code quality, or any improvements you think I should make. I’m open to all kinds of feedback!

Thanks in advance for your time and help!

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

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

Python Daily

Granian vs Daphne

I’m integrating channels into a new project. Previously I’ve used gunicorn with 8 uvicorn workers to run a single asgi app that deals with all http requests and websockets.

I’m wondering if there is an advantage to running a wsgi instance using gunicorn (or granian) for http and a separate asgi instance using Daphne (or uvicorn) solely for handling websockets.

Can anyone suggest which approach is better?

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

Читать полностью…
Подписаться на канал