I just learnt how to connect my Django app to mysql
I just connected my django application to mysql database. I feel so proud of me right now.
https://preview.redd.it/kzb1vv1ww11e1.png?width=500&format=png&auto=webp&s=53f2e376d59d5a7d7bbfca7accec6587505fa6fb
/r/django
https://redd.it/1grubxd
I just connected my django application to mysql database. I feel so proud of me right now.
https://preview.redd.it/kzb1vv1ww11e1.png?width=500&format=png&auto=webp&s=53f2e376d59d5a7d7bbfca7accec6587505fa6fb
/r/django
https://redd.it/1grubxd
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/1grj5d8
# 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/1grj5d8
Redditinc
Reddit Rules
Reddit Rules - Reddit
Dispatchery: Type-aware, multi-arg function dispatch for complex and nested Python types
Links: [Github](https://github.com/bolaft/dispatchery/), [PyPI](https://pypi.org/project/dispatchery/)
**What it does:**
*dispatchery* is a lightweight Python package for function dispatching inspired by the standard *singledispatch* decorator, but with support for complex, nested, parameterized types, like for example *tuple[str, dict[str, int | float]]*.
**Comparison**:
Unlike *singledispatch*, *dispatchery* can dispatch based on:
- Generic parameterized types (e.g. *list[int]*)
- Nested types (e.g. *tuple[str, dict[str, int | float]]*)
- Union types (e.g. *int | str* or *Union[int, str]*)
- Multiple arg and kwarg values, not just the first one
**Target Audience:**
Python developers who don't like having a bunch of *if isinstance* checks everywhere in their code.
**Example :**
from dispatchery import dispatchery
@dispatchery
def my_func(value):
return "Standard stuff."
@my_func.register(list[str])
def _(value):
return "Strings!"
@my_func.register(list[int] | list[float])
def _(value):
return "Numbers!"
@my_func.register(str, int | float, option=str)
def _(value1, value2, option):
return "Two values and a kwarg!"
/r/Python
https://redd.it/1grszm2
Links: [Github](https://github.com/bolaft/dispatchery/), [PyPI](https://pypi.org/project/dispatchery/)
**What it does:**
*dispatchery* is a lightweight Python package for function dispatching inspired by the standard *singledispatch* decorator, but with support for complex, nested, parameterized types, like for example *tuple[str, dict[str, int | float]]*.
**Comparison**:
Unlike *singledispatch*, *dispatchery* can dispatch based on:
- Generic parameterized types (e.g. *list[int]*)
- Nested types (e.g. *tuple[str, dict[str, int | float]]*)
- Union types (e.g. *int | str* or *Union[int, str]*)
- Multiple arg and kwarg values, not just the first one
**Target Audience:**
Python developers who don't like having a bunch of *if isinstance* checks everywhere in their code.
**Example :**
from dispatchery import dispatchery
@dispatchery
def my_func(value):
return "Standard stuff."
@my_func.register(list[str])
def _(value):
return "Strings!"
@my_func.register(list[int] | list[float])
def _(value):
return "Numbers!"
@my_func.register(str, int | float, option=str)
def _(value1, value2, option):
return "Two values and a kwarg!"
/r/Python
https://redd.it/1grszm2
GitHub
GitHub - bolaft/dispatchery: A Python package for advanced function dispatching and method overloading based on complex, nested…
A Python package for advanced function dispatching and method overloading based on complex, nested, and parameterized types. Inspired by functools' singledispatch decorator. - bolaft/dispatchery
PyPI now has attestation. Thanks I hate it.
Blog post: https://blog.pypi.org/posts/2024-11-14-pypi-now-supports-digital-attestations/
I'm angry that it got partially funded by the sovreign tech fund, when it's about "securing" uploads by giving the keys to huge USA companies. I think it's criminal they got public money for this.
I also don't think it adds any security whatsoever. It just moves the authentication from using credentials to PyPI to using credentials to github. They can be stolen in the exact same way.
/r/Python
https://redd.it/1gs05hm
Blog post: https://blog.pypi.org/posts/2024-11-14-pypi-now-supports-digital-attestations/
I'm angry that it got partially funded by the sovreign tech fund, when it's about "securing" uploads by giving the keys to huge USA companies. I think it's criminal they got public money for this.
I also don't think it adds any security whatsoever. It just moves the authentication from using credentials to PyPI to using credentials to github. They can be stolen in the exact same way.
/r/Python
https://redd.it/1gs05hm
blog.pypi.org
PyPI now supports digital attestations - The Python Package Index Blog
Announcing support for PEP 740 on the Python Package Index
D When you say "LLM," how many of you consider things like BERT as well?
I keep running into this argument, but for me when I hear "LLM" my assumption is decoder-only models that are in the billions of parameters. It seems like some people would include BERT-base in the LLM family, but I'm not sure if that's right? I suppose technically it is, but every time I hear someone say "how do I use a LLM for XYZ" they usually bring up LLaMA or Mistral or ChatGPT or the like.
/r/MachineLearning
https://redd.it/1grxbdp
I keep running into this argument, but for me when I hear "LLM" my assumption is decoder-only models that are in the billions of parameters. It seems like some people would include BERT-base in the LLM family, but I'm not sure if that's right? I suppose technically it is, but every time I hear someone say "how do I use a LLM for XYZ" they usually bring up LLaMA or Mistral or ChatGPT or the like.
/r/MachineLearning
https://redd.it/1grxbdp
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
D Neurips 2024 Hotel Roommate Search
The hotels around the venue for Neurips 2024 are pretty expensive, and I'm looking for a roommate to split the cost with (my university has a limit on the nightly hotel rate they are willing to reimburse). I currently have reserved a room for Tuesday-Sunday in the Century Plaza Hotel, which is 0.9 miles from the convention center. The nightly rate is $414. If anyone wants to split the cost of a room, please reach out! Also, it would be helpful if you could share this post with your research group or other attendees that you know.
If you are unsure about rooming with a complete stranger, you can get to know me a little bit through my personal website (https://mtcrawshaw.github.io/), which has links to my google scholar page, CV, etc. I do have a paper at the conference in the area of federated learning/distributed optimization. Just a grad student trying to make conferences affordable! Thanks.
/r/MachineLearning
https://redd.it/1gs0gj8
The hotels around the venue for Neurips 2024 are pretty expensive, and I'm looking for a roommate to split the cost with (my university has a limit on the nightly hotel rate they are willing to reimburse). I currently have reserved a room for Tuesday-Sunday in the Century Plaza Hotel, which is 0.9 miles from the convention center. The nightly rate is $414. If anyone wants to split the cost of a room, please reach out! Also, it would be helpful if you could share this post with your research group or other attendees that you know.
If you are unsure about rooming with a complete stranger, you can get to know me a little bit through my personal website (https://mtcrawshaw.github.io/), which has links to my google scholar page, CV, etc. I do have a paper at the conference in the area of federated learning/distributed optimization. Just a grad student trying to make conferences affordable! Thanks.
/r/MachineLearning
https://redd.it/1gs0gj8
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
Game 987, Like 2048 but Fibonacci (Made in Python)
https://987.reflex.dev/
What My Project Does
From Adhami the author: I was wondering how 2048 would feel like if instead of powers of two, we can merge consequent fibonacci numbers. Turns out to be a rather interesting game that is fairly forgiving and grows very slowly. I found it difficult to come up with an overall strategy. I had a simple search algorithm that was able to achieve a score of exactly 66,666 (not joking). Getting a 987 block shouldn't be difficult.
You can take a look into the code here: https://github.com/adhami3310/987 (the simple search algorithm is inside the code as well)
Target Audience: Anyone
Comparison: Similar to 2048 but fib
/r/Python
https://redd.it/1gs56f7
https://987.reflex.dev/
What My Project Does
From Adhami the author: I was wondering how 2048 would feel like if instead of powers of two, we can merge consequent fibonacci numbers. Turns out to be a rather interesting game that is fairly forgiving and grows very slowly. I found it difficult to come up with an overall strategy. I had a simple search algorithm that was able to achieve a score of exactly 66,666 (not joking). Getting a 987 block shouldn't be difficult.
You can take a look into the code here: https://github.com/adhami3310/987 (the simple search algorithm is inside the code as well)
Target Audience: Anyone
Comparison: Similar to 2048 but fib
/r/Python
https://redd.it/1gs56f7
GitHub
GitHub - adhami3310/987: 2048 but fibonacci
2048 but fibonacci. Contribute to adhami3310/987 development by creating an account on GitHub.
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/1gsaiu7
# 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/1gsaiu7
YouTube
Data Structures and Algorithms in Python - Full Course for Beginners
A beginner-friendly introduction to common data structures (linked lists, stacks, queues, graphs) and algorithms (search, sorting, recursion, dynamic programming) in Python. This course will help you prepare for coding interviews and assessments.
🔗 Course…
🔗 Course…
I played a minute-long video in Windows Terminal
I recently worked on a project combining my love for terminal limits and video art. Here’s what I achieved: • Rendered a 1-minute-long (almost two) ASCII video in the terminal, without graphics libraries or external frameworks. • Used true 24-bit colors for each frame, offering deeper color representation in terminal-based projects. • Processed 432 million characters over 228 seconds, translating each frame’s pixels to colors. • Optimized performance with multi-processing, running on an integrated graphics card.
Specs:
• 30 FPS
• 160,000+ characters per frame
• 2,700 frames
• 3 pixels per character for better performance
For further optimization, I reduced the font size to 3 pixels and used background colors to handle brightness.
What my project does?
While not the most practical project, it’s an experiment I’m satisfied with it. No real use, but hey, it’s fun!
Target audience
This is more of a fun project so I can't say it has a specific target audience, but I could say that people that strangely feels good coding "useless" things might like it.
Comparison
Well it is not an ASCII player anymore to be precise, but what it does now is just display video in the terminal using basically pure ANSI, I
/r/Python
https://redd.it/1gro3kl
I recently worked on a project combining my love for terminal limits and video art. Here’s what I achieved: • Rendered a 1-minute-long (almost two) ASCII video in the terminal, without graphics libraries or external frameworks. • Used true 24-bit colors for each frame, offering deeper color representation in terminal-based projects. • Processed 432 million characters over 228 seconds, translating each frame’s pixels to colors. • Optimized performance with multi-processing, running on an integrated graphics card.
Specs:
• 30 FPS
• 160,000+ characters per frame
• 2,700 frames
• 3 pixels per character for better performance
For further optimization, I reduced the font size to 3 pixels and used background colors to handle brightness.
What my project does?
While not the most practical project, it’s an experiment I’m satisfied with it. No real use, but hey, it’s fun!
Target audience
This is more of a fun project so I can't say it has a specific target audience, but I could say that people that strangely feels good coding "useless" things might like it.
Comparison
Well it is not an ASCII player anymore to be precise, but what it does now is just display video in the terminal using basically pure ANSI, I
/r/Python
https://redd.it/1gro3kl
Reddit
From the Python community on Reddit: I played a minute-long video in Windows Terminal
Explore this post and more from the Python community
Hidden Trigger: Unlock Python’s Built-in Debugging Superpower with PDB
Alert: New Python Tutorial!
Did you know Python has a built-in debugger that can turn you into a bug-slaying detective? In just 5 minutes, learn all the secrets to enhance your debugging skills by using the built-in PDB tool to track down errors, set breakpoints, and inspect your code like a pro!
**tutorial link**
/r/Python
https://redd.it/1gsdcj8
Alert: New Python Tutorial!
Did you know Python has a built-in debugger that can turn you into a bug-slaying detective? In just 5 minutes, learn all the secrets to enhance your debugging skills by using the built-in PDB tool to track down errors, set breakpoints, and inspect your code like a pro!
**tutorial link**
/r/Python
https://redd.it/1gsdcj8
www.rankap.tech
Master Python Debugging with PDB: A Step-by-Step Guide
Learn how to debug Python like a pro using PDB. This guide covers breakpoints, commands, and techniques to fix errors effectively and make debugging an adventure!
Yami - A music player made with Tkinter Now on pypi!
I would like some user feedback
**Github Link:** [https://github.com/DevER-M/yami](https://github.com/DevER-M/yami)
**Pypi Link:** [https://pypi.org/project/yami-music-player/](https://pypi.org/project/yami-music-player/)
**Some of the features**
* ***mp3 , flac, and many audio formats supported for playback***
* ***Clean UI***
* ***Can download music with art cover***
* ***it is also asynchronous***
**Libraries used**
* customtkinter
* spotdl
* mutagen
**Target audience**
This project will be useful for people who do not want ads and want a simple user interface to play music
**Comparison**
There are currently no projects that have all the features covered and is made with tkinterTo use this install all requirements in the .txt file and you are good to go
**RoadMap**
I will update it now and then
A follow would be nice! [https://github.com/DevER-M](https://github.com/DevER-M)
/r/Python
https://redd.it/1grzxre
I would like some user feedback
**Github Link:** [https://github.com/DevER-M/yami](https://github.com/DevER-M/yami)
**Pypi Link:** [https://pypi.org/project/yami-music-player/](https://pypi.org/project/yami-music-player/)
**Some of the features**
* ***mp3 , flac, and many audio formats supported for playback***
* ***Clean UI***
* ***Can download music with art cover***
* ***it is also asynchronous***
**Libraries used**
* customtkinter
* spotdl
* mutagen
**Target audience**
This project will be useful for people who do not want ads and want a simple user interface to play music
**Comparison**
There are currently no projects that have all the features covered and is made with tkinterTo use this install all requirements in the .txt file and you are good to go
**RoadMap**
I will update it now and then
A follow would be nice! [https://github.com/DevER-M](https://github.com/DevER-M)
/r/Python
https://redd.it/1grzxre
GitHub
GitHub - DevER-M/yami: An open-source music player with simple UI
An open-source music player with simple UI. Contribute to DevER-M/yami development by creating an account on GitHub.
Have started the django doc again, and got stuck.
At this part of "Writing your first app", I try to type in "py manage.py startapp polls" and it shows "ModuleNotFoundError: No module named 'polls". Why is that?
/r/djangolearning
https://redd.it/1grq58d
At this part of "Writing your first app", I try to type in "py manage.py startapp polls" and it shows "ModuleNotFoundError: No module named 'polls". Why is that?
/r/djangolearning
https://redd.it/1grq58d
Django Project
Writing your first Django app, part 1 | Django documentation
The web framework for perfectionists with deadlines.
🚀 Feature Friday: PostgreSQL Connection Pools!
Welcome to this week's Django Feature Friday on PostgreSQL Connection Pools!
This small-but-mighty change lets you enable connection pooling with a single line in your settings. This reduces the overhead of accessing your database, leading to improved performance.
You can turn it on like this:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
# ...
"OPTIONS": {
"pool": True,
},
},
}
If you want fine-grained control over your connection pools, you can also explicitly configure them by passing in a dictionary of settings:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
# ...
/r/django
https://redd.it/1grwhlk
Welcome to this week's Django Feature Friday on PostgreSQL Connection Pools!
This small-but-mighty change lets you enable connection pooling with a single line in your settings. This reduces the overhead of accessing your database, leading to improved performance.
You can turn it on like this:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
# ...
"OPTIONS": {
"pool": True,
},
},
}
If you want fine-grained control over your connection pools, you can also explicitly configure them by passing in a dictionary of settings:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
# ...
/r/django
https://redd.it/1grwhlk
Reddit
From the django community on Reddit: 🚀 Feature Friday: PostgreSQL Connection Pools!
Explore this post and more from the django community