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
Storing the password safely

Hello ,

In my project, First the User fill out the register form including password for his account. This data is stored in temporary database. Secondly , If the admin approves him, he/she is registered as user. I am using CustomUser and Custom usermanager. The password which i am saving in temporary database when a user submit form is in plain format. And when the admin approves, it get hashed. I want to store hashed password in temporary database as well. When i use inbuilt mechanisms like make_password, the password get hashed twice , while storing in temp. database and also while storing in Custom User database. How to solve this problem ? I want to hash or secure the password in temp. database while being able to login /logout /authenticate ?

/r/django
https://redd.it/1dvv06l
Streaming Using Django

I have developed a web App and it is audio streaming for songs ( a project for resume ) problem I am facing is LATENCY. While loading home page data which list out available songs ( although I used pagination) and while select a song get to the page where user get to play the song took time to load the song ( although from django I am using 'StreamingHttpResponse' library to stream the data but in fronted where I am using just javascript not able to capture packet by packet and wait to capture whole data ) how to reduce these latencies???

/r/django
https://redd.it/1dvuhxp
Reactive Notebook for Python - An Alternative to Jupyter Notebook

What the Project Does :

Marimo is an open-source reactive notebook for Python: reproducible, git-friendly, executable, shareable as apps.

Run a cell or interact with a UI element, and Marimo automatically runs dependent cells (or marks them as stale), keeping code and outputs consistent. Marimo notebooks are stored as pure Python, executable as scripts, and deployable as apps.

Target Audience :

The project is primarily aimed at data scientists, researchers, and educators. They can make featureful, interactive, and beautiful notebooks that let users filter, slice, and drill-down to their heart's content. Marimo can also enable them to build maintainable internal tools using just Python, without the hassle of custom frontends, infra, endpoints, and deployments.

Comparison :

vs JupyterLite - a WASM powered Jupyter running in the browser. However, it is not reactive like Marimo.

vs IPyflow - a reactive notebook for Python implemented as a Jupyter kernel. However, it is not WASM compatible.

vs Jupyter - marimo is a reinvention of the Python notebook as a reproducible, interactive, and shareable Python program that can be executed as scripts or deployed as interactive web apps - without the need of extensions or additional infrastructure

GitHub repository: https://github.com/marimo-team/marimo



/r/Python
https://redd.it/1dvs2d6
sql-compare: package to compare SQL schemas

## What My Project Does

This package allows to compare two SQL files (or strings) to know whether their statements are the same or not. The comparison doesn't care about the order of the columns in a table or the order of the values in an enumerator. It also excludes irrelevant data like comments.

GitHub repository

PyPI

Its main usage is to compare the schemas of two databases (e.g. staging and production).

At Mergify, we use it in our test suite to check that the migration scripts generated by Alembic will create the database schema expected by the SQLAlchemy models. I wrote a blog post about the creation of the package.

## Target Audience

We use it in our CI/CD. This package is meant for testing mainly, but it could be used for something else probably.

This package is ready for production.

We have been using it at Mergify for several months now. Our test suite fails whenever Alembic misses something in a migration script. We deliver to production several times a day thanks to that.

## Comparison

We didn't find any suitable alternative.

Alembic can compare a database schema with SQLAlchemy models, but it doesn't detect every differences.

We used migra in the past, but it is not maintained anymore.

/r/Python
https://redd.it/1dvsqk7
Help with database commits from a form.

Hello! I'm pretty new to Flask and struggling with transferring data from a form to an SQL Database. The form is within a modal, which works perfectly and will redirect back to the main page once the form is submitted. However, the data from the form is not transferred to the SQL Database that I have associated with this project. I'm sure I'm missing something quite simple, help would be appreciated! If any more code screenshots are needed please let me know.

HTML Template for registration modal: https://i.imgur.com/VIdNGOs.png

Index routing function where the form data is sent to: https://i.imgur.com/zp41FA2.png

/r/flask
https://redd.it/1dw5tqj
Reduce number of models

I currently have:

- ORM model, courtest of SQLAlchemy
- Form model, courtesy of WTForms
- Model logic in routes... Which mostly calls ORM class methods.

How can I consolidate all of that? Any best practices I need to be aware of?

/r/flask
https://redd.it/1dvnq52
I'm a flask addict, convince me to switch to Django

I've been developing web apps with Flask for a while now and love its simplicity and flexibility. It's lightweight and allows me to pick and choose the components I need. However, I've heard a lot about Django's "batteries-included" philosophy and its robust feature set.

Everyone around me says that Django is way better, I really tried to switch but it's really hard.

Convince me why I should give Django a shot!

/r/django
https://redd.it/1dw5q0w
Emotion classification & Analysis

Hello everyone,

I want to share my project that built using flask about in machine learning where user can express there emotion and classify at the following (Sad, Joy, Love, Anger, Fear, Surprice). We use a CNB model for text classification with the accuracy of 88%.

You can try it here:

https://emotionclassification.pythonanywhere.com

Note:

The prediction may encounter a unexpected expression result.

Source code:

- Github

/r/flask
https://redd.it/1dvr9t0
Django AI Assistant - Open-source Lib Launch

Hey folks, we’ve just launched an open-source library called Django AI Assistant, and we’d love your feedback!

What It Does:

* **Function/Tool Calling**: Simplifies complex AI implementations with easy-to-use Python classes
* **Retrieval-Augmented Generation**: Enhance AI functionalities efficiently.
* **Full Django Integration**: AI can access databases, check permissions, send emails, manage media files, and call external APIs effortlessly.

How You Can Help:

1. Try It: [https://github.com/vintasoftware/django-ai-assistant/](https://github.com/vintasoftware/django-ai-assistant/)
2. ▶️ [Watch the Demo](https://www.youtube.com/watch?v=bSJv4OIKLog&ab_channel=VintaSoftware)
3. 📖 [Read the Docs](https://vintasoftware.github.io/django-ai-assistant/latest/get-started/)
4. Test It & Break Things: Integrate it, experiment, and see what works (and what doesn’t).
5. Give Feedback: Drop your thoughts here or on our GitHub issues page.

Your input will help us make this lib better for everyone. Thanks!

/r/djangolearning
https://redd.it/1dw6i4z
I made this using DRF and React

I build a canine blog site using DRF and React as front-end. If you guys have some spare time, can you guys give me some feedback on my project? Any feedback will be greatly appreciated. Thank you. Here are the back-end and front-end code. And here is the project at Netlify. Here are the test username and password: test_user, Canineblog123

/r/djangolearning
https://redd.it/1dw2jtp
New to the web building community - need some advice

Hey Django community!

I'm new to the web building community but not entirely alien to programming. Though, having said that, my experience lies in SQL and SAS.

Can someone advice on the benefits of Django as compared to Flask if I want to build a website for price comparison?

I have an idea where users can compare prices and make the best decision for their purchase.

Read up on the benefits of flask and Django but I am not from a computer science background so I can be quite illiterate to the technical jargons.

Would appreciate if anyone could dumb it down for me and advice me on flask or Django for a "Price Comparison" website!

Thank u!

/r/django
https://redd.it/1dwkyqr
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/1dwcc4t
I'm a Python Backend Developer, How to Create a Modern and Fast Frontend?

Hi everyone,

I'm a backend developer working with Python and I'm looking for a simple and quick way to create a modern and clean frontend (web app) for my Python APIs.

I've been learning Next.js, but I find it a bit difficult and perhaps overkill for what I need.

Are there any tools or platforms for creating simple and modern web apps?
Has anyone else been in the same situation? How did you resolve it?
Do you know of any resources or websites for designing Next.js components without having to build them from scratch?

Thanks in advance for your opinions and recommendations!

/r/Python
https://redd.it/1dwf2sh
Scope Boundaries for Notebooks — Research Study on an extension I've been developing

Hi Everyone. My name is Eric Rawn. I’m a PhD student at UC Berkeley working with my advisor Professor Sarah Chasins. I research how to make notebook programming environments better, and have been working on an extension for notebooks which introduces scope boundaries to collections of cells. We think this might help programmers avoid some of the pain points with notebooks, but we won’t know until we study its use in the real world. The goal is to make it easier to keep variables tidy within a notebook without requiring programmers to change how they like to use notebooks. We’re interested in evaluating how our extension aids how real users program (you all!), and so we’re running a 4-6 week study with folks who use Jupyter notebooks regularly in their everyday programming.

The extension will log some usage data locally on your machine, which you'll send to me at the end of the study. We'll then spend about an hour chatting about your experience, the kind of work you do daily, how you use notebooks, and any other thoughts or feedback you have. Participants will be compensated for their time spent interviewing, at $30/hour. The consent form has detailed information about the

/r/JupyterNotebooks
https://redd.it/1dwbgqr
App 100% python with django. What python frontend can I use?

Hi,
I'm currently using flask + dash bootstrap components for my app.
I'm looking for a 100% python frontend (no react, vue etc).
Any suggestions?

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