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
How stable is Supabase when used with Django?

Is it stable enough to use as a main DB on Django? is there any speed or performance issue when used on Django? Please share your experience with Supbase. I see that Supabase is becoming popular everyday.

/r/django
https://redd.it/1dvmk64
django outstanding token

hello, how the rest_framework_simplejwt in django suppose to be stateless and when i use rest_framework_simplejwt.token_blacklist to logout the user and put in the blacklist, it create an outstanding token table in the database and store the non expired tokens.

/r/django
https://redd.it/1dvk3dr
Tips for learning rest framework

So I'm starting to learn REST framework and need some advice. I'm new to backend development, so can anyone give me advice on how to start, how long it might take, best practices, and what I should focus on?

/r/django
https://redd.it/1dvb9yj
My first gui app (youtube to mp3)

What my project does : Download youtube mp4 video and convert them to mp3.



Target audience : E for everyone.



Comparison : My app has a youtube page integrated in it for ease of use.



Do you guys have some improvement that could be done to the code?



check out the project : https://gitlab.com/sand0ftime1/tube2mp3



I want to make the progress bar work at the same time as the download and also i have some bugs in the todo list.

/r/Python
https://redd.it/1dvltza
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