Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
Django Request Logger: Visualise request behaviour in form of graphs and charts!
/r/django
https://redd.it/1i8023s
DjangoCon 2023 recordings are now available
Hi r/Python, just wanted to annouce that DjangoCon 2023 talks have just been uploaded and as part of Tech Talks Weekly, I went ahead and put together the full list ordered by the number of views:
1. **"Don't Buy the "A.I." Hype with Tim Allen"** ⸱ <100 views ⸱ 20 Jan 2025 ⸱ 00h 26m 26s
2. **"Let's build a BeeWare app that uses Django with Cheuk Ting Ho"** ⸱ <100 views ⸱ 20 Jan 2025 ⸱ 00h 41m 19s
3. **"Using database triggers to reliably track model history with Wes Kendall"** ⸱ <100 views ⸱ 20 Jan 2025 ⸱ 00h 37m 57s
4. **"✨ Modern editing experience for your Django models with Wagtail 🐦 with Sage Abdullah"** ⸱ <100 views ⸱ 20 Jan 2025 ⸱ 00h 24m 27s
5. **"There's More to Open Source than Code by Ramon Huidobro"** ⸱ <100 views ⸱ 20 Jan 2025 ⸱ 00h 16m 24s
6. **"HTML-ivating your Django web app's experience with HTMX, AlpineJS, and streaming HTML - Chris May"** ⸱ <100 views ⸱ 20 Jan 2025 ⸱ 00h 37m 50s
7. **"Nothing for Us, Without Us; Breaking Unconscious Bias in Building Products with Victor Ogunjobi"** ⸱ <100 views ⸱ 20 Jan 2025 ⸱ 00h 22m 17s
8. **"Hosting and DevOps
/r/Python
[https://redd.it/1i77bun
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/1i7q0kh
D Comment on CVPR reviews and ICLR decisions.
Hey everyone,
We all know how reviews and decisions can be controversial, and I’m sure many of you are feeling disappointed with the results (My rating from CVPR is all 2 😅). But remember, it’s not the end of the world!
Rejection doesn’t mean you’re at fault—it’s often just bad luck (though, of course, we should always strive to improve our work).
Take a break—grab some chicken and beers, get a good night’s sleep, and gear up to submit your work to another venue. You’ve got this! 💪
/r/MachineLearning
https://redd.it/1i7nvix
Unable to create virtual environment
I just started learning Flask and want to create a virtual environment within VSCode. I did install the virtualenv package using pip
pip install virtualenv
But when I enter the prompt "virtualenv env" to create a directory, I get a file not found error saying that "system cannot find file specified".
Why am I getting this error and how can I fix this?
/r/flask
https://redd.it/1i7imed
TIL: uv pip install
doesn't compile bytecode installationuv pip install
is way faster than pip install
, but today I learned that is not a completely fair comparison out of the box. By default, pip
will compile .py
files to .pyc
as part of installation, and uv
will not. That being said, uv
is still faster even once you enable bytecode compilation (and you might want to if you're e.g. building a Docker image), but it's not as fast.
More details here: https://pythonspeed.com/articles/faster-pip-installs/
/r/Python
https://redd.it/1i7jz7c
I am using flask for Google sign-in with fedcm but getting following errors...
/r/flask
https://redd.it/1i7dbdq
Integrating Node-RED and Django for Easy Smart Applications Development
Hi Redditors! 👋
I’m excited to share my latest project:
**Node-RED - Django Integration**, which aims to combine **Node-RED**, a fantastic tool for visually building flows, with **Django**, one of the most popular frameworks for web application development.
# What Makes This Project Unique?
In Node-RED, you cannot control user access permissions.
* For example, if you want one user to view a device's readings but not modify them, while another user can both view and edit the device's readings, this is impossible in Node-RED.
* In Django, advanced permission handling is possible.
* You can define specific permissions for each device, allowing precise control over who can view or modify data.
* However, in Django, it is challenging to connect and manage multiple devices or control the flow of data.
* Unlike Node-RED, Django is not designed for creating seamless data flows or automation
Why This Project?
I wanted to explore the possibility of simplifying the development of smart applications using flexible and accessible tools. The goal is to empower developers to create fast, efficient applications by leveraging the strengths of both Node-RED and Django.
[link of project](https://github.com/taha2samy/node_red_-_django-quack_quack-)
# Examples from the Project:)
https://preview.redd.it/ynvvutm1tiee1.png?width=853&format=png&auto=webp&s=b9da984a3aaf91d7bf79bd98faabb32484c8a7b0
#
https://preview.redd.it/sngy1fm3tiee1.png?width=427&format=png&auto=webp&s=f07bbca6a3e38c121d926de806035a7925e12715
https://preview.redd.it/ht9s5ki5tiee1.png?width=1383&format=png&auto=webp&s=a8237be3ff909b68d0a02eec671ce168e6c0ffe7
/r/django
https://redd.it/1i77ztn
Can you share tutorials on django channels?
Hi I am building a app which creates a chat room in a local network for sending messages and files. This is my semester's final project and I thought how hard could it be. I knew how to use python sockets to make this work and thought how hard could it be to integrate it with django. I bit off way more than I could chew.
All I want it that the page updates it real time to display message. From what I read online I have to use websockets and channels to accomplish this, but I have no idea how any of this works. I have seen tutorials online and they all are too complicated and I am overwhelmed. Is there another way around this. All I want is to establish a connection between sockets and django channels. Please help
/r/djangolearning
https://redd.it/1i4ylfu
PhotoshopAPI - bulk read/write PSD files without Photoshop App
Here's some more info about this project: https://github.com/EmilDohne/PhotoshopAPI
What my Project does
PhotoshopAPI is a C++20 Library with Python bindings for reading and writing of Photoshop Files (*.psd and *.psb) based on previous works from psd_sdk, pytoshop and psd-tools. As well as the official Photoshop File Format Specification, where applicable. The library is continuously tested for correctness in its core functionality. If you do find a bug please submit an issue to the github page.
The motivation to create another library despite all the other works present is that there isn't a library which has layer editing as a first class citizen while also supporting all bit-depths known to Photoshop (8-bits, 16-bits, 32-bits). This Library aims to create an abstraction between the raw binary file format and the structure that the user interfaces against to provide a more intuitive approach to the editing of Photoshop Files.
COMPARISON
Photoshop itself is unfortunately often slow to read/write files and the built-in tools for automatically/programmatically modifying files suffer this same issue. On top of this, due to the extensive history of the Photoshop File Format, Photoshop files written out by Photoshop itself are often unnecessarily bloated to add backwards compatibility or cross-software compatibility.
The PhotoshopAPI tries to address these
/r/Python
https://redd.it/1i6t9l7
I don’t understand models
Hello, I’m new to Django and am kinda struggling with understanding models and their structure. If anyone could provide information that would be appreciated.
/r/djangolearning
https://redd.it/1i4yull
Docker + Django: Containerize the Right Way with Nginx, Postgresql & Gunicorn
https://youtu.be/1v3lqIITRJA
/r/django
https://redd.it/1i6tkok
🌈 I created a modern Python logging utility: Tamga
What My Project Does
Tamga is a Python logging package that provides colorful console output and supports multiple logging formats (file, JSON, MongoDB, etc.). It makes Python logging more visually appealing and easier to use.
Target Audience
I originally created this for my FlaskBlog project and kept reusing it in other projects. After copying the code multiple times, I decided to turn it into a package. Anyone who wants prettier and more flexible logging in their Python projects might find it useful.
Comparison
While there are many logging solutions available, Tamga offers colorful output using Tailwind CSS colors and combines multiple features like MongoDB support, email notifications, and file rotation in a simple package.
Quick example:
from tamga import Tamga
logger = Tamga()
logger.info("This is an info message")
logger.warning("This is a warning")
logger.success("This is a success message")
https://github.com/dogukanurker/tamga
/r/Python
https://redd.it/1i5uncl
How much would you guys charge for this? (My first paid gig)
Friend’s business is gonna hire me to automate some admin work. Wants to automate getting their invoices for current day from all ~20 of their vendors portal then download and print them. Should save 30 minutes 3 times a week and he says his personal hourly rate is $60 so if I’m saving him $4500/year in his time assuming 50 working weeks out of the year, is $1000 a fair price to charge him? He’s getting his time back for a fraction of the cost and I’m getting $100/hr assuming roughly 10 hours of work.
/r/Python
https://redd.it/1i6iubh
D Understanding predictive coding networks
Hi all,
I'm trying to understand predictive coding networks like described in Rao & Ballard.
So far I understand that training the network is done through setting the input (and output if training is supervised) and first modifying the activity of the neurons to reduce prediction errors, then modifying the synaptic weights.
What I don't understand is that it seems the activity of a hidden layer "r" seems to be a function of the difference between the prediction and the input (see figure 1.b), it seems implied here that `r` is the product of the transposed weights U^(T) and the prediction error which confuse me : I understand that we want to propagate the prediction error to the next layer, but how can we minimize (I - f(Ur)) if r = U^(T) (I - f(Ur))?
I think I still haven't fully grasped the overall architecture and would really appreciate if someone could help.
/r/MachineLearning
https://redd.it/1i6h40i
How do I find internships?
Hey everyone. I'm currently on the lookout for a Django-related internship and wanted to ask for some advice. I've worked on quite a few Django projects. While I feel confident in my skills, I’m unsure how to approach finding the right internship opportunities.
For those of you who’ve landed Django internships, how did you do it? Did you find opportunities through specific job boards, open-source contributions, or cold emailing companies?
Any tips, resources, or strategies would be super helpful!
Thanks in advance.
/r/django
https://redd.it/1i7ybxu
Improve Python code quality!
After spending about an hour on research for finding the best tools that can improve code quality, I came up with this trio:
- Linter: Ruff
- Formatter: Black
- Type Checker: Pyright
Is this good? Are there any suggestions you guys can give?
/r/Python
https://redd.it/1i7wus6
Jypter Tries Opening in Photoshop instead of Browser
I am taking a Python class at my college, and as part of the class, we installed Anaconda and the Jypter Notebook to write our code in. Whenever I try to open Jypter Notebook, it opens up Photoshop on my laptop.
The TA for my class had me uninstall Photoshop, and it got Jypter Notebook to run. However, I need to keep Photoshop on my laptop for my internship, so I would prefer not to have to uninstall and re-install it.
Do y'all know a potential work around for this?
I appreciate any advice, thank you all.
Edit:
I just realized that i misspelled Juypter, my bad
/r/IPython
https://redd.it/1i7plj8
Best practice for allowing access to users without an account
I need to provide access to users who don't have an account on the site, and I want it to be properly routed. We manage condo associations, and want to let tenants report problems. Owners are no problem, they already have a website account to pay condo fees etc. But tenants don't. Is there a better way to do it than just giving them a url with a long UUID (ie domain.com/request/\[UUID\](http://domain.com/request/UUID) or similar) where the UUID would be tied to a particular unit so we could share it with the appropriate condo board?
/r/django
https://redd.it/1i7pxeo
Setting Up Django for Success
Hello everyone,
I wrote a getting started guide I wish I had myself when I got started with Django around 8 years ago. It goes from setting up a virtual environment using `uv` to having a server side rendered front-end application hydrated using Vue. I tried to write it in such a way that you could achieve the same by using React/Svelte instead of Vue by only changing the Vite template. It contains a short piece of Django Rest Framework to demonstrate persistence via an authenticated API.
It's a collection of ideas that worked for me and others in the Django community. Some from books such as Two Scoops of Django. Others from resources such as LearnDjango.com or DjangoCon US talks. Of course duly credited where mentioned.
https://jilles.me/setting-up-django-for-success/
Hopefully there is something useful in there for everyone. I think it's a nice middle-ground between a completely empty Django project and a fully fledged django-cookiecutter.
/r/django
https://redd.it/1i7ekq1
Hardening my Django server
I've had a Django app running on a Digital Ocean droplet for several years without issue. Lately it would run out of memory on complex queries. The CPU was also hitting high levels. I decided to move to a Hetzner VM - 4 times the CPU and 4 times the memory for about the same price. Having updated all the software dependencies and dome lots of testing I finally migrated to the new server on Sunday. On Tuesday, by coincidence, I got a notification from Digital Ocean Security saying that they had received a report that my old DO server was making unauthorized connection attempts on a remote third-party server via SSH. As I now no longer needed that server, I responded by destroying it. (I don't have the time and expertise to analyse exactly what was going on.
Of course, I want to avoid such an issue recurring on the new server. So my question is: What measures beyond the standard Django deployment checklist (which I had followed) do you recommend for your Django servers? I'm using Nginx and Gunicorn on an ARM platform. I'm thinking of libraries like fail2ban, maybe a Web Application Firewall, scanners for malicious code
/r/django
https://redd.it/1i7br7c
Hello dear friends, I use Django 5 and I have problem
*\*\** $ python [manage.py](http://manage.py) runserver
Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). Error: You don't have permission to access that port. (venv) *\*\**
How I can solve it ?
/r/django
https://redd.it/1i7bo7h
DjangoCon 2023 recordings are now available
https://www.techtalksweekly.io/i/155417658/djangocon
/r/django
https://redd.it/1i77axl
D: A 3blue1brown Video that Explains Attention Mechanism in Detail
- YouTube video
- subtitle
# Timestamps
02:21 : token embedding
02:33 : in the embedding space \
there are multiple distinct directions for a word \
encoding the multiple distinct meanings for the word.
02:40 : a well-trained attention block \
calculates what you need to add to the generic embedding \
to move it to one of these specific directions, \
as a function of the context. \
07:55 : Conceptually think of the Ks as potentially answering the Qs.
11:22 : ( did not understand )
/r/MachineLearning
https://redd.it/1i6zh6p
Where is the community?
I’m learning Python and Flask as I’ll need it for a job I’m starting soon. Previously I’ve been involved with the iOS development community and there’s a pretty big community on X (Twitter). Is there a similar community for Flask/Python on X? Is it here on Reddit? What’s the best way to get involved?
/r/flask
https://redd.it/1i6saf4
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/1i6xdhu
Python Fixed-Point Converter
Hey everyone, [PyFi](https://github.com/CesarPiresSevero/pyfi) is a library that helps converting fixed-point to floating-point and vice-versa.
* What My Project Does: Converts floating and fixed-point implementations
* Target Audience: Algorithm developers
* Comparison: Simpler solution with only one class and method
It can be very hand for someone doing fixed-point algorithm implementations. Here is an example:
>PYTHON FIXED POINT CONVERTER
>Configuration:
-Type of conversion: Floating to fixed point
-Signedness: Signed
-Total bits: 32
-Fractional bits: 31
>WARNING: 1.0 can not be represented, 0.99999999977 will be used instead ( index: 0 )
>Converted values:
>-Dec (Input): 0.99999999977,-0.50000000000
>-Hex (Output): 0x7fffffff,0xc0000000
>-Bin (Output): 0b01111111111111111111111111111111,0b1100000000000000000000000000000
/r/Python
https://redd.it/1i6qeh7
How to Visualize your Project's Dependency Graph
https://www.gauge.sh/blog/how-to-visualize-your-python-projects-dependency-graph
I built a tool that helps you visualize your Python's dependency graph, as well as enforce state on it! Would love thoughts / comments / feedback. Source code here: https://github.com/gauge-sh/tach
/r/Python
https://redd.it/1i6n3zl
My First Big Django App - Blogino (Not Completed Yet)
Hey everyone,
I’ve been working on my first big Django project called Blogino, and I wanted to share my progress so far. It’s still a work in progress, but I’m excited to get feedback from the community!
https://github.com/MLankaoui/blogino
/r/djangolearning
https://redd.it/1i4ww7o
Magnetron is a minimalist machine learning framework built entirely from scratch.
What My Project Does
Magnetron is a minimalist machine learning framework built entirely from scratch. It’s meant to be to PyTorch what MicroPython is to CPython—compact, efficient, and easy to hack on. Despite having only 48 operators at its core, Magnetron supports cutting-edge ML features such as multithreading with dynamic scaling. It automatically detects and uses the most optimal vector runtime (SSE, AVX, AVX2, AVX512, and various ARM variants) to ensure performance across different CPU architectures, all meticulously hand-optimized. We’re actively working on adding more high-impact examples, including LLaMA 3 inference and a simple NanoGPT training loop.
GitHub: https://github.com/MarioSieg/magnetron
Target Audience
• ML Enthusiasts & Researchers who want a lightweight, hackable framework to experiment with custom operators or specialized use cases.
• Developers on constrained systems or anyone seeking minimal overhead without sacrificing modern ML capabilities.
• Performance-conscious engineers interested in exploring hand-optimized CPU vectorization that adjusts automatically to your hardware.
Comparison
• PyTorch/TensorFlow: Magnetron is significantly lighter and easier to understand under-the-hood, making it ideal for experimentation and embedded systems. We don’t (yet) have the breadth of official libraries or the extensive community, but our goal is to deliver serious performance in a minimal package.
• Micro frameworks: While some smaller ML projects exist, Magnetron stands out by
/r/Python
https://redd.it/1i63rmk