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

Better Error Tracking in Django (using Bugsink)
https://www.bugsink.com/blog/better-error-tracking-in-django/

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

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

Python Daily

Modern JS in Django

I would like to know how you all handle modern js in your django projects, stuff like installing third-party package, usage of bundlers or no build approach. I wanna improve my DX, so I interested on how other django dev do

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

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

Python Daily

I made an open source, self hostable, AI meeting Copilot

Hey Everyone 👋

I recently built **Amurex**, a self-hosted AI meeting copilot that actually works:

**What My Project Does**

Amurex is a self-hosted AI meeting copilot that:

* Records meetings seamlessly (no bot interruptions).
* Delivers accurate transcripts instantly.
* Drafts follow-up emails automatically.
* Keeps a memory of past meetings for easy context.
* Provides **real-time engagement suggestions** during boring meetings (unique feature!).

It’s open source, self-hosted, and ensures full data privacy with no subscriptions or vendor lock-in. And of course, it uses [Robyn](https://github.com/sparckles/Robyn) as the backend ;)

**Target Audience**

Perfect for professionals, privacy-conscious users, and open-source enthusiasts who want smarter meeting tools.

**Comparison**

|**Feature**|**Amurex**|**Others**|
|:-|:-|:-|
|Real-Time Suggestions|Yes|No|
|Seamless Recording|Yes|Bot interruptions|
|Self-Hosted Privacy|Full control|Third-party servers|

**GitHub**: [https://github.com/thepersonalaicompany/amurex](https://github.com/thepersonalaicompany/amurex)
**Website**: [https://www.amurex.ai/](https://www.amurex.ai/)

Would love to know what you all think of it. 😊

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

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

Python Daily

Implementing Retrieval-Augmented Generation with LangChain, Pgvector and OpenAI

https://www.codemancers.com/blog/2024-10-24-rag-with-langchain/?utm\_source=Social+media&utm\_medium=reddit

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

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

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

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

Python Daily

Rest GET api deployed in flask+gunicorn giving 404 error

I have deployed a REST GET api in my development environment using gunicorn+flask on linux. However, I'm getting 404 error. This api used to work in the same environment before but now started getting 404. I checked the code and the url map as well in my flask app and this api is listed there. Any ideas how to troubleshoot this thing.

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

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

Python Daily

Build your Jupyter dashboard using Solara
https://blog.jupyter.org/build-your-jupyter-dashboard-using-solara-569fa5b16e9c

/r/IPython
https://redd.it/1hh1tcg

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

Python Daily

D Best survey papers of 2024?

As an AI researcher who is starting out, I usually start by seeing survey papers related to a field, then creating a roadmap to further deep dive into my research topic. I am eager to see the sub's viewpoint of the best survey papers they came across in 2024.

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

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

Python Daily

I built web app using Django!

Hello everyone 👋,

I just wanted to show off a web app I made using Django. Outside of tutorial projects, this is my first official project. It's called Salted Vanilla and it's a scented candle cataloging web app.

I used this tutorial by Kostja to start the project and I built from there. I'm using Appliku to deploy on AWS Lightsail. I used ChatGPT to help with model structure and relationships. I am using Django templates, a little Bootstrap, and most recently Bootstrap Studio for the front end.


Here is the git repo


Here is a video demo you can check out


If you have any critiques on structure or anything, please let me know!

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

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

Python Daily

Spotify data visualizations

* **What My Project Does**

My project offers a visualization of spotify data through a web application.

* **Target Audience**

The project is aimed at anyone who uses Spotify and likes music

* **Comparison**

My project is different from a classic Spotify wrapped because it offers new features, is interactive and allows you to select the period of interest. Plus you can watch it more than once a year :)


Feel free to give me suggestions with pull requests and issues as I plan to expand the project further. [Github](https://github.com/marcobadiello/Esame-Sistemi-2.git)

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

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

Python Daily

Displaying HTTP response code in Jinja

I want to display the response code sent from my Flask backend (e.g. 400 200 201 etc.) in Jinja - how can I access this?

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

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

Python Daily

Py-Cachify 2.0 - Distributed Locks and Handy Caching Decorators

What My Project Does

Py-Cachify is a robust caching and locking library for Python applications. I recently published a significant 2.0 update introducing several improvements, including enhanced locking versatility, revamped documentation, automatically attachable helper methods, and more. This library simplifies the implementation of caching and locking, offering decorators to easily integrate these features into your code.


Target Audience

This library is ideal for developers looking to optimize their Python applications, whether for production use or personal projects. Its features cater to both novice and experienced Python developers.


Comparison

Py-Cachify focuses on the simplicity of cache and lock implementations, prioritizing ease and flexibility of use in any app over complex caching/locking strategies. One of its standout features is dynamic key generation based on function signatures without any external dependency, allowing you to cache function results with context-aware keys.

Additionally, it works in both synchronous and asynchronous environments and is fully type-annotated for enhanced IDE support.


The source code is on GitHub.

The new documentation is here.

Feedback and feature requests are appreciated!

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

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

Python Daily

TypeScribe: A Python GUI App for organic Handwritten Text Generation with Machine Learning

Hey folks, just sharing a little side project I have been working on.

I was looking for a handwritten text generator, but since most of them rely on fixed fonts, the consistency becomes an obvious give away. So, I decided to build one on my own.

# TypeScribe v1.0

I'm excited to introduce TypeScribe, a program that converts text into organic handwritten text using a Recurrent Neural Network (RNN) trained on real handwriting samples. In documents generated with TypeScribe, every stroke, curve, and loop is unique.

What My Project Does

With TypeScribe, you can customize every aspect of the your handwritten documents including:

12 unique handwriting styles to choose from
Page, Line and Margin color customization
Page Dimensions
Ink Color, Pen Thickness Customization
Handwriting Consistency (Neatness)
and many more!

Target Audience

With TypeScribe, you can:

1. Create organic handwritten letters (in cursive!).
2. Fill in your notebooks!
3. Send out handwritten Christmas cards, just in time!
4. Add a personal touch to absolutely anything.

TypeScribe can automatically split large texts into multiple pages, and YOU get to specify how many lines to write per page!

When you create a document with TypeScribe, it generates an SVG file that can be scaled with zero loss in quality. All you have to do is paste

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

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

Python Daily

selfie-lib - snapshot testing *and* caching/memoization (useful for testing against genAI)

# What My Project Does

selfie-lib is a snapshot testing library ([docs](https://selfie.dev/py/get-started#quickstart), [source](https://github.com/diffplug/selfie)), with a few novel features. At its most basic, it functions like `print` but it writes into your sourcecode instead of the console. You write a test like this:

expect_selfie(primes_under(15)).to_be_TODO()

When you run the test, selfie automatically rewrites the test code by calling `repl()` on the result of `primes_under(15)`, e.g.

expect_selfie(primes_under(15)).to_be([2, 3, 5, 7, 11, 13])

Now that the method call is `to_be` instead of `to_be_TODO`, this will throw an `AssertionError` if the `primes_under(15)` call ever changes its output.

That's standard snapshot testing stuff, the other things it can do are

* save snapshots inline with the source code or on disk
* [https://selfie.dev/py/facets#harmonizing-disk-and-inline-literals](https://selfie.dev/py/facets#harmonizing-disk-and-inline-literals)
* you can use snapshots to cache/memoize the results of slow & non-deterministic APIs (e.g generative AI), and build other test infrastructure on top of that snapshotted data
* [https://selfie.dev/py/cache#example](https://selfie.dev/py/cache#example)

# Target Audience

**People who test their code with** `print`. Just replace `print` with `expect_selfie(...).to_be_TODO()` and you can turn that `print` into a repeatable test.

**People who are building applications with nondeterministic or slow components, such as generative AI.** You don't want to hit the model for every unit test on the

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

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

Python Daily

Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

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

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

Python Daily

JH container shows regular CPU spikes even when no clients are connected: normal behavior?

I'm running the JupyterHub single-user image and noticing spikes in CPU usage ever ~30s or so

Is this normal for JH? Looking at the output of top in the container shows the python3 process is being called periodically. Any thoughts on how I can troubleshoot this assuming it's not normal behavior? Thanks.

/r/IPython
https://redd.it/1hhvom8

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

Python Daily

How to Set Up a Django Frontend: A Complete Tutorial

Today, I shared a guide on setting up the Django frontend, diving into file structure, static files, and how to integrate them seamlessly.

* **Blog Link :** [How to Set Up a Django Frontend: A Complete Tutorial](https://django-learning.hashnode.dev/how-to-set-up-a-django-frontend-a-complete-tutorial)

This blog builds on the previous one, where we explored Django Admin and Models, including tips on creating classes and using foreign keys effectively.

* **Previous Blog Link** : [How to Use Django Admin and Models: A Beginner’s Guide](https://django-learning.hashnode.dev/how-to-use-django-admin-and-models-a-beginners-guide)
* **First Blog Link :** [Getting Started with Django: Basic Setup and Overview](https://django-learning.hashnode.dev/django-setup-and-basic-overview)

Give it a read and let me know your thoughts in the comments! 💬 Your feedback helps me make these guides even better! 😊

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

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

Python Daily

This Django Template Tag is Killing Your Performance
https://mirat.dev/articles/djangoda-tehlikeli-template-etiketi-length/

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

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

Python Daily

I made a step-by-step tutorial on setting up JWT authentication with HttpOnly cookies using Django and Next.js

This is my second DRF JWT authentication tutorial. I made it because, after my first tutorial, where tokens were stored in local storage, I was asked for an httpOnly cookies implementation and for more detailed explanations for each step.

In this tutorial, I tried to keep things simple; I didn’t add too many custom features. Instead, I focused on explaining the process as I coded, while trying not to be too boring.

Here’s the link:
https://youtu.be/TS1v\_-ppICk

I really hope you find it helpful! Feel free to let me know your thoughts or if you have any suggestions!

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

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

Python Daily

Deployed my basic app to Render but CSS isn’t working

I have “django-tailwind” installed in my project the theme name is “theme”

I ran collect static and pushed to git. When I run gunicorn on my local machine after collecting static it worked.


My images shows up, but my tailwind css isn’t showing.

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

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

Python Daily

Benchmark library that uses PostgreSQL

I am writing an open-source library that simplifies CRUD operations for PostgreSQL. The most similar library would be SQLAlchemy Core.

I plan to benchmark my library against SQLAlchemy ORM, SQLAlchemy Core, and SQLModel. I am unsure about the setup. I have the following considerations:

\- Local DB vs Remote DB. Or both?
\- My library depends on psycopg. Should I only use psycopg for the others?
\- Which test cases should I cover?
\- My library integrates pydantic / msgspec for serialisation and validation. What' the best practice for SQLAlchemy here? Do I need other libraries?

What are your opinions. Do you maybe have some good guidelines or examples?

My library is not yet released but quite stable. You can find more details here:
Github: https://github.com/dakivara/pgcrud
Docs: https://pgcrud.com

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

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

Python Daily

Django reaches its 2024 fundraising goal 🌈🎉

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

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

Python Daily

Where to store passwords in production

Hello everyone. I have a flask app i want to deploy on pythonanywhere. In my app i have a function that sends an email and i need to store a password for the email that is a sender. My question is how do i store that password safely when deployed so that i cant be viewed. Also would appreciate if anyone can suggest any other sites for deployment of flask apps. Thanks

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

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

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

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

Python Daily

What features should all flask apps have?

I've been programming for about a year and a half now and built a small flask app to manage my music business. Basically a management application with some API integration and sqlalchemy. The app now works fine and is stable, but I'm wondering if there are any features/functions/etc. that all flask apps should have implemented, that don't seem obvious to a beginner like me. Cybersecurity and complex algorhithms still go a bit beyond my understanding, but I wanna make my app as secure, stable and reliable as possible.

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

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

Python Daily

WOWY - A Full-Featured E-commerce Platform with Stripe Integration

Hi everyone! I wanted to share my Django e-commerce project that I've been working on. It's a comprehensive solution with a modern UI and robust admin features.

# Key Features

**Product Management**

* Multi-image product support with primary/gallery images
* Category management
* Stock tracking
* Price and discount management
* Advanced search/filtering

**Orders & Payments**

* Stripe integration
* Cash on delivery option
* PDF invoice generation
* Order status tracking
* Multiple shipping addresses

**User Features**

* Customer accounts/profiles
* Wishlist functionality
* Real-time cart operations
* Order history
* Address management

**Admin Dashboard**

* Sales analytics and reporting
* Customer insights
* Product performance metrics
* Payment method analysis
* Comprehensive order management

**Technical Details**

* Django 4.x
* PostgreSQL/SQLite
* Stripe/djstripe for payments
* Bootstrap for frontend
* jQuery for interactivity

**Code Example**
Here's how the Stripe integration is implemented:

class StripeMixin:
def setup_stripe(self):
"""Configure Stripe with API keys from djstripe"""
try:
# Get Stripe keys from djstripe
publishable_key = APIKey.objects.get(type=APIKeyType.publishable).secret


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

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

Python Daily

AF

My flask code display 'Method Not Found' ,although the "GET" request is working properly . Can any one help me ,please

https://preview.redd.it/fmkkpnbwx87e1.png?width=921&format=png&auto=webp&s=2df436fb1e713a05fb33fc31f4ef8c00f5432bd8



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

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

Python Daily

Advice for Landing an Entry-Level Django Developer Job Without Professional Experience

Hi everyone,

I’ve been learning Django for a while and have built a few personal projects to strengthen my skills. While I feel confident in my abilities, I don’t yet have professional development experience. Because of this, I’ve been struggling to land an entry-level or junior developer role.

I’d love to hear feedback or advice from seasoned developers or anyone currently working in the field. Your feedback and advice are truly priceless to me, and I deeply appreciate any insights you can share.

I’m planning to include my resume and a link to my portfolio in this post for reference. Any tips or suggestions on how I can improve them, or general advice about entering the field, would mean a lot to me.

Thank you so much for your time and help!

Portfolio , Resume

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

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

Python Daily

Laravel Developer Inheriting a Flask App

Hey all - I've been writing web apps in Laravel pretty much exclusively for the past 10 years. I was hired on by a client who said their previous developer was bailing on them and taking his code with him and I had 3 weeks to recreate his work. I was excited for the challenge. Now they've made nice enough with the previous developer (paying him the $50k of back pay they owed him - red flag!) that he's going to give me the source for the existing app. Turns out it's written in Python/Flask.

They're giving it to me in an AWS AMI that I theoretically just spin up in a new environment and it's good to go - includes all the RabbitMQ stuff, cron jobs, apache setup, etc.

The kicker though is that they want me to sign on to support this thing for a year or more. I was excited about that part too when I thought it was something I was going to write from the ground up and know inside and out. Supporting somebody else's stuff in a stack I don't understand... different enchilada.

Anybody here worked in both Laravel and Flask that might have some insight

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

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

Python Daily

P Graph-Based Editor for LLM Workflows

We made an open-source tool that provides a graph-based interface for building, debugging, and evaluating LLM workflows: https://github.com/PySpur-Dev/PySpur

Why we built this:

Before this, we built several LLM-powered applications that collectively served thousands of users. The biggest challenge we faced was ensuring reliability: making sure the workflows were robust enough to handle edge cases and deliver consistent results.

In practice, achieving this reliability meant repeatedly:

1. Breaking down complex goals into simpler steps: Composing prompts, tool calls, parsing steps, and branching logic.
2. Debugging failures: Identifying which part of the workflow broke and why.
3. Measuring performance: Assessing changes against real metrics to confirm actual improvement.

We tried some existing observability tools or agent frameworks and they fell short on at least one of these three dimensions. We wanted something that allowed us to iterate quickly and stay focused on improvement rather than wrestling with multiple disconnected tools or code scripts.

We eventually arrived at three principles upon which we built PySpur :

1. Graph-based interface: We can lay out an LLM workflow as a node graph. A node can be an LLM call, a function call, a parsing step, or any logic component. The visual structure provides an instant overview, making complex workflows more intuitive.
2. Integrated debugging: When

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

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