Newly uploaded Python talks from Pycon Sweden 2024 and Pydata London 2024
Hello again r/Python!
I've recently published the newest issue of Tech Talks Weekly newsletter that I'm building and I noticed that this time around there are plenty of fresh talks from two major Python conferences: PyCon Sweden 2024 and PyData London 2024. I decided to repost them here, so here we go:
# 1. PyCon Sweden 2024
1. **"Debugging Python by Juha-Matti Santala"** ⸱ +100 views ⸱ 26 Jun 2024 ⸱ 00h 25m 41s
2. **"Lightning talks"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 42m 15s
3. **"Python Developer Experience with Polylith by David Vujic"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 32m 40s
4. **"GraphQL as an umbrella for microservices by Artur Smęt"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 32m 10s
5. **"Load testing with Python and Locust by Lars Holmberg"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 30m 17s
6. **"CALFEM - Teaching the Finite Element method in Python by Jonas Lindemann"** ⸱ <100 views ⸱ 27 Jun 2024 ⸱ 00h 35m 34s
7. **"Closing remarks of PyCon Sweden 2023"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 23m 02s
8. **"Opening Talk by PyCon Chairman, Alexander Hultner"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 11m
/r/Python
https://redd.it/1dqnhfv
Hello again r/Python!
I've recently published the newest issue of Tech Talks Weekly newsletter that I'm building and I noticed that this time around there are plenty of fresh talks from two major Python conferences: PyCon Sweden 2024 and PyData London 2024. I decided to repost them here, so here we go:
# 1. PyCon Sweden 2024
1. **"Debugging Python by Juha-Matti Santala"** ⸱ +100 views ⸱ 26 Jun 2024 ⸱ 00h 25m 41s
2. **"Lightning talks"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 42m 15s
3. **"Python Developer Experience with Polylith by David Vujic"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 32m 40s
4. **"GraphQL as an umbrella for microservices by Artur Smęt"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 32m 10s
5. **"Load testing with Python and Locust by Lars Holmberg"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 30m 17s
6. **"CALFEM - Teaching the Finite Element method in Python by Jonas Lindemann"** ⸱ <100 views ⸱ 27 Jun 2024 ⸱ 00h 35m 34s
7. **"Closing remarks of PyCon Sweden 2023"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 23m 02s
8. **"Opening Talk by PyCon Chairman, Alexander Hultner"** ⸱ <100 views ⸱ 26 Jun 2024 ⸱ 00h 11m
/r/Python
https://redd.it/1dqnhfv
YouTube
Debugging Python by Juha-Matti Santala
Abstract: Debugging can be a stressful experience to a developer. In this talk, I provide practical and hands-on tips both for dealing both with the mental side and the technical tools and approaches that can help Python developers turn stressful debugging…
Atollas - a column level type system for pandas
Hey folks!
I do a lot of stuff professionally with pandas and dask, and I always reeeeaaaly wish that they had a column level type system. I feel like a lot of bugs like, one-to-one joins on non unique columns, or just plain old incorrect source data would be quicker to find if there was one.
So I've written one - or at least started to. It's pretty early stage, but I'm pretty excited about it as an idea. Would love some feedback people (especially ones that work with pandas a lot)!
So here's my little project, hope it's interesting to someone!
## What my Project Does
Provides a column level type system for pandas, to catch bugs earlier and check for things like, join operation validity.
## Target Audience
People looking to put pandas code into production with better reliability that pandas provides out the box.
## Comparison
I don't know of any 1-2-1 comparison, things like polars have good type checking internally, but don't make any attempt to type check columns. Pandera is the closest project, which gives a decorator to enforce schemas at type boundaries)
/r/Python
https://redd.it/1dqm1y4
Hey folks!
I do a lot of stuff professionally with pandas and dask, and I always reeeeaaaly wish that they had a column level type system. I feel like a lot of bugs like, one-to-one joins on non unique columns, or just plain old incorrect source data would be quicker to find if there was one.
So I've written one - or at least started to. It's pretty early stage, but I'm pretty excited about it as an idea. Would love some feedback people (especially ones that work with pandas a lot)!
So here's my little project, hope it's interesting to someone!
## What my Project Does
Provides a column level type system for pandas, to catch bugs earlier and check for things like, join operation validity.
## Target Audience
People looking to put pandas code into production with better reliability that pandas provides out the box.
## Comparison
I don't know of any 1-2-1 comparison, things like polars have good type checking internally, but don't make any attempt to type check columns. Pandera is the closest project, which gives a decorator to enforce schemas at type boundaries)
/r/Python
https://redd.it/1dqm1y4
GitHub
GitHub - benrutter/atollas: Typed rails for pandas
Typed rails for pandas. Contribute to benrutter/atollas development by creating an account on GitHub.
Push Notifications With Javascript - Kieran Oldfield Web Development
https://kieranoldfield.co.uk/blog/push-notifications-with-javascript/
/r/djangolearning
https://redd.it/1dqdnhy
https://kieranoldfield.co.uk/blog/push-notifications-with-javascript/
/r/djangolearning
https://redd.it/1dqdnhy
kieranoldfield.co.uk
Push Notifications With Javascript - Kieran Oldfield Web Development
Push notifications, when used appropriately, can be a useful and engaging tool for any website and can remind users to come back to visit your content. Let me show you how to implement it!
Thoughts on Teaching Python to Children
MIT's Scratch is a very successful online environment for teaching kids to program. The statistics give an idea of how popular it is - for example, 36 million unique visitors last month.
It enables visitors to create stories using a visual "drag-and-drop" language and to post their creations to a public gallery. It also allows creators to add "remix" code from other students as well.
The "Scratch" programming language has no commercial uses that I am aware of, so people must be visiting the site just for the pure pleasure of learning to program and sharing what they produce with others.
There is a wide age distribution of ages of the people visiting the Scratch site but there is a peak at about age 12 after which it falls quite rapidly.
I think that there are several reasons for the popularity of Scratch:
1. it is easy to learn and understand
2. there is nothing to install or set up
3. you can start by modifying existing examples
4. you can share what you have created by simply pressing "Save"
5. stories can be visually exciting with lots of animation effects
6. Scratch is written in JavaScript and can run on mobile devices
When comparing this to Python, I
/r/Python
https://redd.it/1dqstt2
MIT's Scratch is a very successful online environment for teaching kids to program. The statistics give an idea of how popular it is - for example, 36 million unique visitors last month.
It enables visitors to create stories using a visual "drag-and-drop" language and to post their creations to a public gallery. It also allows creators to add "remix" code from other students as well.
The "Scratch" programming language has no commercial uses that I am aware of, so people must be visiting the site just for the pure pleasure of learning to program and sharing what they produce with others.
There is a wide age distribution of ages of the people visiting the Scratch site but there is a peak at about age 12 after which it falls quite rapidly.
I think that there are several reasons for the popularity of Scratch:
1. it is easy to learn and understand
2. there is nothing to install or set up
3. you can start by modifying existing examples
4. you can share what you have created by simply pressing "Save"
5. stories can be visually exciting with lots of animation effects
6. Scratch is written in JavaScript and can run on mobile devices
When comparing this to Python, I
/r/Python
https://redd.it/1dqstt2
scratch.mit.edu
Scratch - Imagine, Program, Share
Scratch is a free programming language and online community where you can create your own interactive stories, games, and animations.
I have spent all day trying to upload an image from a form. Please help
settings.py:
STATIC_URL = 'static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static")
]
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
forms.py:
class SignUp(forms.Form):
is_doctor = forms.BooleanField(label = "Are you a doctor?",required=False)
f_name = forms.CharField(label = "First Name", max_length=200)
l_name = forms.CharField(label="Last Name",max_length=200)
username = forms.CharField(label = "Username",max_length = 100)
email = forms.CharField(label = "Email",max_length=200)
profile_pic = forms.ImageField(label= "Profile Picture", widget = forms.ClearableFileInput(attrs= {'class':'form-control'}))
password = forms.CharField(label ="Password",max_length=200)
confirm_password = forms.CharField(label = "Confirm Password",max_length=200)
address = forms.CharField(label="Address",max_length = 400)
views.py:
def signup(response):
if response.method == "POST":
form = SignUp(response.POST,response.FILES)
/r/djangolearning
https://redd.it/1dqv3xw
settings.py:
STATIC_URL = 'static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static")
]
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
forms.py:
class SignUp(forms.Form):
is_doctor = forms.BooleanField(label = "Are you a doctor?",required=False)
f_name = forms.CharField(label = "First Name", max_length=200)
l_name = forms.CharField(label="Last Name",max_length=200)
username = forms.CharField(label = "Username",max_length = 100)
email = forms.CharField(label = "Email",max_length=200)
profile_pic = forms.ImageField(label= "Profile Picture", widget = forms.ClearableFileInput(attrs= {'class':'form-control'}))
password = forms.CharField(label ="Password",max_length=200)
confirm_password = forms.CharField(label = "Confirm Password",max_length=200)
address = forms.CharField(label="Address",max_length = 400)
views.py:
def signup(response):
if response.method == "POST":
form = SignUp(response.POST,response.FILES)
/r/djangolearning
https://redd.it/1dqv3xw
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
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/1dqy1qp
# 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/1dqy1qp
Amazon
Fluent Python: Clear, Concise, and Effective Programming
Fluent Python: Clear, Concise, and Effective Programming [Ramalho, Luciano] on Amazon.com. *FREE* shipping on qualifying offers. Fluent Python: Clear, Concise, and Effective Programming
Flask Migrate issues
Hi,
I recently started reading the "Learning Flask Framework 2nd Edition" ebook from Packt publishing, the major issue seems to be that the book is from 2015 and the flask frameworks have evolved over time to the point that some of the code won't work without tweaks. One of the issues I have is with Flask Migrate, I can't seem to get it to work, It complains about not being able to import certain modules, not sure if it's a circular dependancy or what but even if flask db migrate succeeds, it generates drop table statements that nukes the database if you do a flask db upgrade.
It's quite difficult to fix for a noob at Python / Flask. Wondering if anyone can suggest some fixes? If I need to post a zip of my folder structure I can find a way to do that - I've being trying all sorts so there might be some junk in the source files.
Thanks in advance.
/r/flask
https://redd.it/1dqtdvc
Hi,
I recently started reading the "Learning Flask Framework 2nd Edition" ebook from Packt publishing, the major issue seems to be that the book is from 2015 and the flask frameworks have evolved over time to the point that some of the code won't work without tweaks. One of the issues I have is with Flask Migrate, I can't seem to get it to work, It complains about not being able to import certain modules, not sure if it's a circular dependancy or what but even if flask db migrate succeeds, it generates drop table statements that nukes the database if you do a flask db upgrade.
It's quite difficult to fix for a noob at Python / Flask. Wondering if anyone can suggest some fixes? If I need to post a zip of my folder structure I can find a way to do that - I've being trying all sorts so there might be some junk in the source files.
Thanks in advance.
/r/flask
https://redd.it/1dqtdvc
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
What's the best practice for scaling a Django app?
What's the best practice for scaling a Django app?
• Django + Elastic Beanstalk
• Django + Docker + Fargate
• Django + Kubernetes + Docker + EKS
Have you guys tried all three? which one works the best when handling a large amount of traffic?
/r/django
https://redd.it/1dqwmww
What's the best practice for scaling a Django app?
• Django + Elastic Beanstalk
• Django + Docker + Fargate
• Django + Kubernetes + Docker + EKS
Have you guys tried all three? which one works the best when handling a large amount of traffic?
/r/django
https://redd.it/1dqwmww
Reddit
From the django community on Reddit
Explore this post and more from the django community
How to Master Django
I am a beginner to backend development and databases,
I followed a few tutorials and built a blog app and chat app.
I was trying to build an e-commerce website backend using Django and PostgreSQL on my own but I'm messing up everything.
Please list good resources to learn Django and backend development.
/r/django
https://redd.it/1dr5m91
I am a beginner to backend development and databases,
I followed a few tutorials and built a blog app and chat app.
I was trying to build an e-commerce website backend using Django and PostgreSQL on my own but I'm messing up everything.
Please list good resources to learn Django and backend development.
/r/django
https://redd.it/1dr5m91
Reddit
From the django community on Reddit
Explore this post and more from the django community
PSQLPy - Asynchronous Python PostgreSQL driver written in Rust
Hello everyone. We want to present you PSQLPy: our new project that allows communicate with PostgreSQL. Conceptually it's similar to psycopg or asyncpg but fully written in Rust and type hints support.
What Our Project Does
- Make an interaction with the PostgeSQL in your application much faster (2-3 times).
- Be sure that there won't be any unexpected errors.
- Don't usually go to the documentation to search every question - we have awesome docstrings for every component.
- Use MyPy (or any other Python type checker) with confidence that exactly the types specified in the typing will be returned.
- Concentrate on writing your code, not understanding new abstractions in this library, we only have classes which represents PostgreSQL object (transaction, cursor, etc).
Target Audience
The driver is completely ready for production use, supports high-load and fault-tolerant systems
Comparison
We conducted a huge number of benchmarks.
The results are very promising! PSQLPy is faster than AsyncPG at best by 2 times, at worst by 20%. PsycoPG is 3.5 times slower than our new driver in the worst case, 60% in the best case.
Links:
Github repo: https://github.com/qaspen-python/psqlpy
Docs: https://qaspen-python.github.io
We would be pleased to see valuable feedback.
Best regards, PSQLPy team.
/r/Python
https://redd.it/1dqybfa
Hello everyone. We want to present you PSQLPy: our new project that allows communicate with PostgreSQL. Conceptually it's similar to psycopg or asyncpg but fully written in Rust and type hints support.
What Our Project Does
- Make an interaction with the PostgeSQL in your application much faster (2-3 times).
- Be sure that there won't be any unexpected errors.
- Don't usually go to the documentation to search every question - we have awesome docstrings for every component.
- Use MyPy (or any other Python type checker) with confidence that exactly the types specified in the typing will be returned.
- Concentrate on writing your code, not understanding new abstractions in this library, we only have classes which represents PostgreSQL object (transaction, cursor, etc).
Target Audience
The driver is completely ready for production use, supports high-load and fault-tolerant systems
Comparison
We conducted a huge number of benchmarks.
The results are very promising! PSQLPy is faster than AsyncPG at best by 2 times, at worst by 20%. PsycoPG is 3.5 times slower than our new driver in the worst case, 60% in the best case.
Links:
Github repo: https://github.com/qaspen-python/psqlpy
Docs: https://qaspen-python.github.io
We would be pleased to see valuable feedback.
Best regards, PSQLPy team.
/r/Python
https://redd.it/1dqybfa
GitHub
GitHub - psqlpy-python/psqlpy: Asynchronous Python PostgreSQL driver written in Rust
Asynchronous Python PostgreSQL driver written in Rust - psqlpy-python/psqlpy
Can I make use of sessions without cookies?
I run an ecommerce platform, my users want to embed their stores (hosted by me) in their sites using iframes.
The problem is that iframes + incognito/Safari = bricked store, because cookies are blocked.
I was wondering if there's a workaround for using sessions without cookies?
Like passing around the session_key/sessionid as GET parameters in every action?
/r/django
https://redd.it/1dr2trl
I run an ecommerce platform, my users want to embed their stores (hosted by me) in their sites using iframes.
The problem is that iframes + incognito/Safari = bricked store, because cookies are blocked.
I was wondering if there's a workaround for using sessions without cookies?
Like passing around the session_key/sessionid as GET parameters in every action?
/r/django
https://redd.it/1dr2trl
Reddit
From the django community on Reddit
Explore this post and more from the django community
PuePy - Reactive Frontend Framework
## What PuePy Project Does
PuePy builds on PyScript (Python+Webassembly) to offer something similar to Vue.js or React, but in 100% pure Python. It supports PyScript's two runtimes: MicroPython and Pyodide. MicroPython is tiny, while Pyodide is basically CPython.
## Target Audience
Presumably anyone who wants to have a web project where they code the frontend in Python, not JavaScript. This might be a limited number of people, however, because it does mean you'll miss out on JavaScript tooling (eg, in-browser debuggers), JavaScript projects, etc.
You can, however, make use of web components like Shoelace.style, so you're not necessarily starting from scratch.
## Comparison
There are a lot of Python "frontend" options, though none I'm aware of are quite like PuePy.
- Reflex lets you define React-style logic in Python and it runs in the browser. It doesn't, however, let you have a full Python environment on the client.
- LTK is a GUI toolkit written with PyScript that you could use to build powerful frontend frameworks. However, it isn't reactive and does presume you're going to use it as a toolkit in a roughly similar way to how you'd use Gtk or Qt, but on the web.
- Flet is a Flutter wrapper in Python where a thin
/r/Python
https://redd.it/1dr7xfu
## What PuePy Project Does
PuePy builds on PyScript (Python+Webassembly) to offer something similar to Vue.js or React, but in 100% pure Python. It supports PyScript's two runtimes: MicroPython and Pyodide. MicroPython is tiny, while Pyodide is basically CPython.
## Target Audience
Presumably anyone who wants to have a web project where they code the frontend in Python, not JavaScript. This might be a limited number of people, however, because it does mean you'll miss out on JavaScript tooling (eg, in-browser debuggers), JavaScript projects, etc.
You can, however, make use of web components like Shoelace.style, so you're not necessarily starting from scratch.
## Comparison
There are a lot of Python "frontend" options, though none I'm aware of are quite like PuePy.
- Reflex lets you define React-style logic in Python and it runs in the browser. It doesn't, however, let you have a full Python environment on the client.
- LTK is a GUI toolkit written with PyScript that you could use to build powerful frontend frameworks. However, it isn't reactive and does presume you're going to use it as a toolkit in a roughly similar way to how you'd use Gtk or Qt, but on the web.
- Flet is a Flutter wrapper in Python where a thin
/r/Python
https://redd.it/1dr7xfu
Pyscript.net
PyScript is a platform for Python in the browser.
Need help with creating custom validators for a Serializer in Django REST framework
I am writing a serializer for a complicated
This is how I am attempting to create custom validators:
My validator class:
class MyCustomValidator:
requirescontext = True
def call(self, value, serializerfield):
context = serializerfield.context
print(f"got this context: {context}")
my serializer:
class MySerializer(serializers.Serializer):
myfield = serializers.IntegerField(required=True, validators=MyCustomValidator())
sending context in my view:
def getserializercontext(self):
context = super().getserializercontext()
/r/django
https://redd.it/1drdla1
I am writing a serializer for a complicated
put API with a large validate function. To simplify the logic and make it more readable, I want to create validators for individual fields (I want to make my serializer class as small as possible and hence don't want to write individual validate methods for each field). I am passing context to my serializer from the view and each of my fields share a common context. I want to use that context in the validator to perform the required checks.This is how I am attempting to create custom validators:
My validator class:
class MyCustomValidator:
requirescontext = True
def call(self, value, serializerfield):
context = serializerfield.context
print(f"got this context: {context}")
my serializer:
class MySerializer(serializers.Serializer):
myfield = serializers.IntegerField(required=True, validators=MyCustomValidator())
sending context in my view:
def getserializercontext(self):
context = super().getserializercontext()
/r/django
https://redd.it/1drdla1
Reddit
From the django community on Reddit
Explore this post and more from the django community
Run mgcv package in python via rpy2
I am trying to create a python package to run mgcv in R, to replace the functionality of pyGAM. I want to start with the r command gam(), and need to use rpy2 to transfer data from R. I don't know how to define the command in python to encapsulate the functionality of running the gam command from r (mainly to simplify the python code), and I am trying to understand some of the functions of the pymer4 package on how data is transferred between the two languages.
I don't have a lot of experience with developing packages and I'd like to understand a little bit about how these functions are defined
/r/Python
https://redd.it/1drdq78
I am trying to create a python package to run mgcv in R, to replace the functionality of pyGAM. I want to start with the r command gam(), and need to use rpy2 to transfer data from R. I don't know how to define the command in python to encapsulate the functionality of running the gam command from r (mainly to simplify the python code), and I am trying to understand some of the functions of the pymer4 package on how data is transferred between the two languages.
I don't have a lot of experience with developing packages and I'd like to understand a little bit about how these functions are defined
/r/Python
https://redd.it/1drdq78
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Integrating issue between django and react
hello my team is building full stack web app using django and react .
i am working on Django and others are working on react .
now we have started integrating them and we are getting error.
i have diagnosed the problem little bit and i found that the error is with static file and src link in frontend , because it always gives me "not Found Error" . so the issue might be with linking .
anyone hear has any knowledge or experienced such problem pls help , as deadline is near
https://preview.redd.it/yn94d4mzui9d1.png?width=422&format=png&auto=webp&s=c6c6a8329b6c299a4afbde3d567c9fc19da368ad
https://preview.redd.it/cpzw37mzui9d1.png?width=848&format=png&auto=webp&s=f4b791aba1988859bfe71cd6d46c6b1460532426
/r/django
https://redd.it/1drck77
hello my team is building full stack web app using django and react .
i am working on Django and others are working on react .
now we have started integrating them and we are getting error.
i have diagnosed the problem little bit and i found that the error is with static file and src link in frontend , because it always gives me "not Found Error" . so the issue might be with linking .
anyone hear has any knowledge or experienced such problem pls help , as deadline is near
https://preview.redd.it/yn94d4mzui9d1.png?width=422&format=png&auto=webp&s=c6c6a8329b6c299a4afbde3d567c9fc19da368ad
https://preview.redd.it/cpzw37mzui9d1.png?width=848&format=png&auto=webp&s=f4b791aba1988859bfe71cd6d46c6b1460532426
/r/django
https://redd.it/1drck77
Django Rest Browsable API vs axios post
Hey everyone,
I recently started logging the time requests take in my django project.
I have a rest framework viewset for a model with a custom action that performs a lot of processing and a complex lookup on that model.
It all works fine, but I have come to realize that when I use the form in the browsable rest_framework api, the code on the serverside is executed twice as fast as when i call the very same action from a template using axios/fetch or anything similar.
I logged the time for every function that is being executed in the view and they all run at minimum twice as fast.
I cannot figure out why. Does anyone have an idea why?
Thanks!
/r/django
https://redd.it/1drmbh7
Hey everyone,
I recently started logging the time requests take in my django project.
I have a rest framework viewset for a model with a custom action that performs a lot of processing and a complex lookup on that model.
It all works fine, but I have come to realize that when I use the form in the browsable rest_framework api, the code on the serverside is executed twice as fast as when i call the very same action from a template using axios/fetch or anything similar.
I logged the time for every function that is being executed in the view and they all run at minimum twice as fast.
I cannot figure out why. Does anyone have an idea why?
Thanks!
/r/django
https://redd.it/1drmbh7
Reddit
From the django community on Reddit
Explore this post and more from the django community
Sunday Daily Thread: What's everyone working on this week?
# Weekly Thread: What's Everyone Working On This Week? 🛠️
Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
## How it Works:
1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.
## Guidelines:
Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.
## Example Shares:
1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
/r/Python
https://redd.it/1dromws
# Weekly Thread: What's Everyone Working On This Week? 🛠️
Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
## How it Works:
1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.
## Guidelines:
Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.
## Example Shares:
1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
/r/Python
https://redd.it/1dromws
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Sonos Moments - A simple web app to control Sonos speakers
I finally open-sourced my tiny side-project where I implemented a web app for controlling Sonos speakers, especially switching between pre-defined "moments".
**Link**: [Sonos Moments](https://github.com/falkoschindler/sonos_moments)
After the latest update of the official [Sonos app for Android](https://play.google.com/store/apps/details?id=com.sonos.acr2) with an average rating of 1.2 stars, I needed an alternative solution for common tasks like changing the volume or pausing/unpausing the music. And starting my morning routine with a single click is not possible at all with the official app. Apart from that it is a great opportunity to use [NiceGUI](https://nicegui.io/) for rapidly solving a real-world problem at hand.
**What My Project Does**
* Provide a simple web UI for controlling Sonos speakers in a local network.
* Allow capturing and managing the state of multiple speakers ("moments") and restoring them with a single click.
* Allow to quickly play/pause speakers and control their volume without opening the official mobile app.
**Target Audience**
* Python developers and smart home enthusiasts in need for a better Sonos app.
**Comparison**
* As far as I'm aware, there is no other open-source web UI for Sonos speakers.
/r/Python
https://redd.it/1drczng
I finally open-sourced my tiny side-project where I implemented a web app for controlling Sonos speakers, especially switching between pre-defined "moments".
**Link**: [Sonos Moments](https://github.com/falkoschindler/sonos_moments)
After the latest update of the official [Sonos app for Android](https://play.google.com/store/apps/details?id=com.sonos.acr2) with an average rating of 1.2 stars, I needed an alternative solution for common tasks like changing the volume or pausing/unpausing the music. And starting my morning routine with a single click is not possible at all with the official app. Apart from that it is a great opportunity to use [NiceGUI](https://nicegui.io/) for rapidly solving a real-world problem at hand.
**What My Project Does**
* Provide a simple web UI for controlling Sonos speakers in a local network.
* Allow capturing and managing the state of multiple speakers ("moments") and restoring them with a single click.
* Allow to quickly play/pause speakers and control their volume without opening the official mobile app.
**Target Audience**
* Python developers and smart home enthusiasts in need for a better Sonos app.
**Comparison**
* As far as I'm aware, there is no other open-source web UI for Sonos speakers.
/r/Python
https://redd.it/1drczng
GitHub
GitHub - falkoschindler/sonos_moments: Simple web application based on SoCo and NiceGUI to control Sonos speakers in a local network
Simple web application based on SoCo and NiceGUI to control Sonos speakers in a local network - falkoschindler/sonos_moments
FastAPI + Django Admin is the best practice?
Hey guys! I wanted to use Django Admin for my FastAPI project, namely django-unfold. So what do you think about this idea?
My used orm: SQLAlchemy
/r/django
https://redd.it/1drj08o
Hey guys! I wanted to use Django Admin for my FastAPI project, namely django-unfold. So what do you think about this idea?
My used orm: SQLAlchemy
/r/django
https://redd.it/1drj08o
Reddit
From the django community on Reddit
Explore this post and more from the django community
Discord trading bot
I follow a very successful day trader that posts all his trades on discord. I was wondering if it would be possible to develop a bot that buys and sells a stock exactly when he posts his trades. I have no experience in programming but I really want to create this bot so that I can make trades while I do my day job. Any help is appreciated.
/r/Python
https://redd.it/1drx7qr
I follow a very successful day trader that posts all his trades on discord. I was wondering if it would be possible to develop a bot that buys and sells a stock exactly when he posts his trades. I have no experience in programming but I really want to create this bot so that I can make trades while I do my day job. Any help is appreciated.
/r/Python
https://redd.it/1drx7qr
Reddit
From the Python community on Reddit
Explore this post and more from the Python community