I’m developing a programming game where you use Python to automate all kinds of machines, robots, drones and more and solve exciting bite-sized coding challenges. (playtesting now)
Earlier this year, I first announced JOY OF PROGRAMMING here on r/python and it was met with an overwhelmingly positive reception. Your interest and support really mean a lot! In case you missed it, the game is all about using Python to solve challenging tasks in realistic, physically simulated 3D environments. It covers a wide range of topics, and hopefully presents interesting challenges and fun for all skill levels.
If you are interested in the game, you can find a lot more information on the Steam page.
https://store.steampowered.com/app/2216770/JOY\_OF\_PROGRAMMING\_\_Software\_Engineering\_Simulator
Today, I’d also like to invite you all to finally try an early version of the game! This alpha version focuses mainly on the beginner tutorials (6 at the moment) with one advanced level. Your feedback how difficult, engaging and ultimately fun the game and these levels are would be invaluable. I’m running this playtest on a newly created Discord server to make providing feedback and fixing bugs as seamless as possible. Please find the download link and all further details on Discord.
https://discord.com/invite/2ZrdzkNeBP
Happy Coding!
/r/Python
https://redd.it/12qn0ku
Earlier this year, I first announced JOY OF PROGRAMMING here on r/python and it was met with an overwhelmingly positive reception. Your interest and support really mean a lot! In case you missed it, the game is all about using Python to solve challenging tasks in realistic, physically simulated 3D environments. It covers a wide range of topics, and hopefully presents interesting challenges and fun for all skill levels.
If you are interested in the game, you can find a lot more information on the Steam page.
https://store.steampowered.com/app/2216770/JOY\_OF\_PROGRAMMING\_\_Software\_Engineering\_Simulator
Today, I’d also like to invite you all to finally try an early version of the game! This alpha version focuses mainly on the beginner tutorials (6 at the moment) with one advanced level. Your feedback how difficult, engaging and ultimately fun the game and these levels are would be invaluable. I’m running this playtest on a newly created Discord server to make providing feedback and fixing bugs as seamless as possible. Please find the download link and all further details on Discord.
https://discord.com/invite/2ZrdzkNeBP
Happy Coding!
/r/Python
https://redd.it/12qn0ku
Steampowered
JOY OF PROGRAMMING - Software Engineering Simulator on Steam
Use real Python code to automate machines, robots, drones and more: Program self-driving vehicles; crack passwords; apply machine learning; automate logistics; use image processing to guide missiles. Gain real coding skills and solve exciting bite-sized programming…
Kangas V2: Explore multimedia data
Project: [https://github.com/comet-ml/kangas](https://github.com/comet-ml/kangas)
Demo: [https://kangas.comet.com/](https://kangas.comet.com/)
​
We've just released version 2 of Kangas, our open source platform for exploring large, multimedia datasets. At a high-level, Kangas provides:
* A Python interface for constructing large tables of multimedia data (DataGrids), which should be very familiar to any Pandas users.
* A backend built on SQLLite and Flask for storing/querying/serving DataGrids.
* A UI built on React Server Components with Next 13 that enables fast, interactive exploration of your data
https://i.redd.it/ldpbbkb70nua1.gif
Kangas provides out of the box support for complex querying operations, as well as a variety of computer vision functionality (bounding boxes, labels, annotations, etc.) Additionally, the UI is customizable—you can resize, filter, and reorder columns as you like.
You can run Kangas from within a notebook, as a local app via the Kangas CLI, or even deploy it as a standalone web application (as we've done at [https://kangas.comet.com](https://kangas.comet.com))
Finally, I want to include a thank you here. About 5 months ago, I shared Kangas' initial V1 release here in r/Python, and several of you made your way over to the repo to share feedback and support. This was massively helpful for us. It helped us figure out what to prioritize, and opened our eyes to new features we hadn't considered.
/r/Python
https://redd.it/12qlmup
Project: [https://github.com/comet-ml/kangas](https://github.com/comet-ml/kangas)
Demo: [https://kangas.comet.com/](https://kangas.comet.com/)
​
We've just released version 2 of Kangas, our open source platform for exploring large, multimedia datasets. At a high-level, Kangas provides:
* A Python interface for constructing large tables of multimedia data (DataGrids), which should be very familiar to any Pandas users.
* A backend built on SQLLite and Flask for storing/querying/serving DataGrids.
* A UI built on React Server Components with Next 13 that enables fast, interactive exploration of your data
https://i.redd.it/ldpbbkb70nua1.gif
Kangas provides out of the box support for complex querying operations, as well as a variety of computer vision functionality (bounding boxes, labels, annotations, etc.) Additionally, the UI is customizable—you can resize, filter, and reorder columns as you like.
You can run Kangas from within a notebook, as a local app via the Kangas CLI, or even deploy it as a standalone web application (as we've done at [https://kangas.comet.com](https://kangas.comet.com))
Finally, I want to include a thank you here. About 5 months ago, I shared Kangas' initial V1 release here in r/Python, and several of you made your way over to the repo to share feedback and support. This was massively helpful for us. It helped us figure out what to prioritize, and opened our eyes to new features we hadn't considered.
/r/Python
https://redd.it/12qlmup
GitHub
GitHub - comet-ml/kangas: 🦘 Explore multimedia datasets at scale
🦘 Explore multimedia datasets at scale. Contribute to comet-ml/kangas development by creating an account on GitHub.
Using React with Django
My Django app is now becoming bigger, and the front end part (in vanilla JS) becomes pretty unmaintainable. I would like to change the front end to React, since it is component based and so it is more organized. It also has a dedicated testing framework for front-end use (unlike vanilla JS), and so I can ensure my front-end logic is robust. Does anyone ever done migration from Vanilla JS to React? How would the Django template work there? Does it work the same, and if so was it hard to write tests for them?
/r/django
https://redd.it/12qqxrv
My Django app is now becoming bigger, and the front end part (in vanilla JS) becomes pretty unmaintainable. I would like to change the front end to React, since it is component based and so it is more organized. It also has a dedicated testing framework for front-end use (unlike vanilla JS), and so I can ensure my front-end logic is robust. Does anyone ever done migration from Vanilla JS to React? How would the Django template work there? Does it work the same, and if so was it hard to write tests for them?
/r/django
https://redd.it/12qqxrv
Reddit
r/django on Reddit: Using React with Django
Posted by u/aldosebastian - 28 votes and 28 comments
Restrict access unless user is on a certain domain?
I’ve been asking a lot of questions recently. I’m getting ready to deploy my Django site soon. However, to ensure there’s further security. I only want it to be accessible to users on a certain domain. Meaning, once they are connected to a certain VPN domain. *.mydomain.com, access is allowed and user can log in. If they aren’t on that domain, they aren’t able to view or log in.
/r/djangolearning
https://redd.it/12r2gjt
I’ve been asking a lot of questions recently. I’m getting ready to deploy my Django site soon. However, to ensure there’s further security. I only want it to be accessible to users on a certain domain. Meaning, once they are connected to a certain VPN domain. *.mydomain.com, access is allowed and user can log in. If they aren’t on that domain, they aren’t able to view or log in.
/r/djangolearning
https://redd.it/12r2gjt
Reddit
r/djangolearning on Reddit: Restrict access unless user is on a certain domain?
Posted by u/HeadlineINeed - 2 votes and 7 comments
Out of curiosity: what is the python project structure you usually go gor?
/r/Python
https://redd.it/12qit60
/r/Python
https://redd.it/12qit60
Reddit
r/Python on Reddit: Out of curiosity: what is the python project structure you usually go gor?
Posted by u/MeGuaZy - 93 votes and 88 comments
Python's pathlib Module: Taming the File System – Real Python
https://realpython.com/python-pathlib/
/r/Python
https://redd.it/12qo5ji
https://realpython.com/python-pathlib/
/r/Python
https://redd.it/12qo5ji
Realpython
Python's pathlib Module: Taming the File System – Real Python
Python's pathlib module enables you to handle file and folder paths in a modern way. This built-in module provides intuitive semantics that work the same way on different operating systems. In this tutorial, you'll get to know pathlib and explore common tasks…
Wednesday Daily Thread: Beginner questions
New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/12r9j0k
New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/12r9j0k
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
Websocket connection failed & Not Found: /ws/home/room
new to django-channels and websockets in python and have been struggling with a big project, I can't figure out why I keep getting the errors in the title I even created a new project and followed a youtube tutorial step by step and still get the error
\- the main difference between mine and his is that my user flow goes through three pages -> login to home to the room- I also didn't initialize a virtual environment for my django project (don't think that matters)
from inspection i get websocket connection not found 'ws:// {localhost}/ws/home/room' and from project console i get Not Found: /ws/home/roomI'm trying to learn as I go about websockets and everything but have been struggling with this issue for a while now (a couple days lol)
heres my code:
[urls.py](https://urls.py)
`urlpatterns = [path('', views.login, name='login'),path('home/', views.home, name='home'),path('home/<str:room_name>/', views.room, name='room'),]`
[routing.py](https://routing.py)
`websocket_urlpatterns = [re_path(r'^ws/home/(?P<room_name>\w+)/$', consumers.GameConsumer),]`
[consumers.py](https://consumers.py)
`class GameConsumer(AsyncWebsocketConsumer):def __init__(self, *args, **kwargs):super().__init__(args, kwargs)self.room_name = Noneself.room_group_name = Noneasync def connect(self):self.room_name = self.scope['url_route']['kwargs']['room_name']self.room_group_name = '_%s' % self.room_name # unsure about 'game_%s'''' create new group '''await self.channel_layer.group_add(self.room_group_name,self.channel_name,)`
`await self.accept()`
`await self.channel_layer.group_send(self.room_group_name,{'type': 'tester_message','tester': 'hello world',})`
`async def tester_message(self, event):tester = event['tester']`
`await self.send(text_data=json.dumps({'tester': tester}))`
`async def disconnect(self, close_code):await self.channel_layer.group_discard(self.room_group_name,self.channel_name,)`
and heres where i create the websocket connection
`{{ room_name|json_script:"room-name" }}<script>const roomName = JSON.parse(document.getElementById('room-name').textContent)const socket = new WebSocket('ws://' +window.location.host
/r/djangolearning
https://redd.it/12r4wnx
new to django-channels and websockets in python and have been struggling with a big project, I can't figure out why I keep getting the errors in the title I even created a new project and followed a youtube tutorial step by step and still get the error
\- the main difference between mine and his is that my user flow goes through three pages -> login to home to the room- I also didn't initialize a virtual environment for my django project (don't think that matters)
from inspection i get websocket connection not found 'ws:// {localhost}/ws/home/room' and from project console i get Not Found: /ws/home/roomI'm trying to learn as I go about websockets and everything but have been struggling with this issue for a while now (a couple days lol)
heres my code:
[urls.py](https://urls.py)
`urlpatterns = [path('', views.login, name='login'),path('home/', views.home, name='home'),path('home/<str:room_name>/', views.room, name='room'),]`
[routing.py](https://routing.py)
`websocket_urlpatterns = [re_path(r'^ws/home/(?P<room_name>\w+)/$', consumers.GameConsumer),]`
[consumers.py](https://consumers.py)
`class GameConsumer(AsyncWebsocketConsumer):def __init__(self, *args, **kwargs):super().__init__(args, kwargs)self.room_name = Noneself.room_group_name = Noneasync def connect(self):self.room_name = self.scope['url_route']['kwargs']['room_name']self.room_group_name = '_%s' % self.room_name # unsure about 'game_%s'''' create new group '''await self.channel_layer.group_add(self.room_group_name,self.channel_name,)`
`await self.accept()`
`await self.channel_layer.group_send(self.room_group_name,{'type': 'tester_message','tester': 'hello world',})`
`async def tester_message(self, event):tester = event['tester']`
`await self.send(text_data=json.dumps({'tester': tester}))`
`async def disconnect(self, close_code):await self.channel_layer.group_discard(self.room_group_name,self.channel_name,)`
and heres where i create the websocket connection
`{{ room_name|json_script:"room-name" }}<script>const roomName = JSON.parse(document.getElementById('room-name').textContent)const socket = new WebSocket('ws://' +window.location.host
/r/djangolearning
https://redd.it/12r4wnx
Astral, the company behind Ruff
https://astral.sh/blog/announcing-astral-the-company-behind-ruff
I am not Charlie Marsh, so this isn't my blog. But I found the premise and the news very interesting and exciting!
/r/Python
https://redd.it/12r7oi0
https://astral.sh/blog/announcing-astral-the-company-behind-ruff
I am not Charlie Marsh, so this isn't my blog. But I found the premise and the news very interesting and exciting!
ruff has become a can't-live-without tool very quickly, and I'm excited to see what comes out of Astral next/r/Python
https://redd.it/12r7oi0
astral.sh
Announcing Astral, the company behind Ruff
Astral’s mission is to make the Python ecosystem more productive by building high-performance developer tools, starting with Ruff.
Handling Security of Encrypted Data
I want to make an application that is related to crypto. The user would enter a password, that would decrypt a crypto wallet key that is stored in a SQL database, and allow them to use this wallet to run transactions.
I do not want them to enter it for every action, I want to store the decrypted wallet key/the password (ill refer to either as the key) somewhere so it is a smooth interaction. I am curious about the security ethics around this. Where would I store the key, in browser cookies on the client side? If so, how secure is this, and how secure is sending the key back and forth via POSTS to the backend server?
/r/flask
https://redd.it/12r96bd
I want to make an application that is related to crypto. The user would enter a password, that would decrypt a crypto wallet key that is stored in a SQL database, and allow them to use this wallet to run transactions.
I do not want them to enter it for every action, I want to store the decrypted wallet key/the password (ill refer to either as the key) somewhere so it is a smooth interaction. I am curious about the security ethics around this. Where would I store the key, in browser cookies on the client side? If so, how secure is this, and how secure is sending the key back and forth via POSTS to the backend server?
/r/flask
https://redd.it/12r96bd
Reddit
Handling Security of Encrypted Data : r/flask
80K subscribers in the flask community. Flask is a Python micro-framework for web development. Flask is easy to get started with and a great way to…
Dockerized Django with Postgres, Gunicorn, and Traefik (with Let's Encrypt)
Hey fellow Django enthusiasts!
I've created a cool project template that you can use as a foundation for your future projects by simply copying it: https://github.com/amerkurev/django-docker-template
The main idea is to solve all deployment-related issues at the initial stage. In this project, everything is built in Docker, launched with Docker Compose, and Let's Encrypt certificate is automatically issued (you just need to have a domain). The certificate is also automatically renewed. It is configured through environment variables and described how to work in development mode and how to deploy to production.
But the most important thing is the minimalism of this project. It has nothing extra, it's easy to extend or modify.
Personally, I now use it everywhere I need to quickly deploy a Django website. And it only takes me a couple of minutes to deploy everything in the cloud. Then I just write my Django applications.
​
I would be very happy if you want to support the project with a PR, an interesting idea, or find bugs and write about it in the issue. Or at least give the project a star :)
I really love Django and value the Django community because it's a really cool product and cool people!
/r/django
https://redd.it/12r59gh
Hey fellow Django enthusiasts!
I've created a cool project template that you can use as a foundation for your future projects by simply copying it: https://github.com/amerkurev/django-docker-template
The main idea is to solve all deployment-related issues at the initial stage. In this project, everything is built in Docker, launched with Docker Compose, and Let's Encrypt certificate is automatically issued (you just need to have a domain). The certificate is also automatically renewed. It is configured through environment variables and described how to work in development mode and how to deploy to production.
But the most important thing is the minimalism of this project. It has nothing extra, it's easy to extend or modify.
Personally, I now use it everywhere I need to quickly deploy a Django website. And it only takes me a couple of minutes to deploy everything in the cloud. Then I just write my Django applications.
​
I would be very happy if you want to support the project with a PR, an interesting idea, or find bugs and write about it in the issue. Or at least give the project a star :)
I really love Django and value the Django community because it's a really cool product and cool people!
/r/django
https://redd.it/12r59gh
GitHub
GitHub - amerkurev/django-docker-template: Dockerized Django with Postgres, Gunicorn, and Traefik or Caddy (with auto renew Let's…
Dockerized Django with Postgres, Gunicorn, and Traefik or Caddy (with auto renew Let's Encrypt) - amerkurev/django-docker-template
Sample flash app can't be accessed by other device in the local network with host="0.0.0.0" & turned off firewall
I created a simple flash app as followings ...
\---------------
from flask import Flask
app = Flask(__name__)
@ app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run(host="0.0.0.0")
\---------------
Running the same flask app on both Windows machine#1 (M1) and Windows Machine#2 (M2). M2 can access to M1. No issue. However, the other way around didn't work.
\-- M2 is running flask app with host="0.0.0.0." and turned off firewall from McAfee
\-- M1 can't access the M2 flask app by ip address (192.168.0.111)
\>>> http://192.168.0.111:5000
Any ideas how to troubleshoot this?
/r/flask
https://redd.it/12r6eao
I created a simple flash app as followings ...
\---------------
from flask import Flask
app = Flask(__name__)
@ app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run(host="0.0.0.0")
\---------------
Running the same flask app on both Windows machine#1 (M1) and Windows Machine#2 (M2). M2 can access to M1. No issue. However, the other way around didn't work.
\-- M2 is running flask app with host="0.0.0.0." and turned off firewall from McAfee
\-- M1 can't access the M2 flask app by ip address (192.168.0.111)
\>>> http://192.168.0.111:5000
Any ideas how to troubleshoot this?
/r/flask
https://redd.it/12r6eao
Reddit
r/flask on Reddit: Sample flash app can't be accessed by other device in the local network with host="0.0.0.0" & turned off firewall
Posted by u/rockies_user - 1 vote and 3 comments
Chili - serialize/deserialize anything from/to dict/json
Hi Python enthusiasts!
I'm thrilled to announce the launch of Chili 2.0, a major update to my object serialization and deserialization library with JSON support. After 2 years of development, I'm excited to share this new version with the Python community.
Chili is a Python library that makes it easy to serialize and deserialize any Python object to and from dict and/or JSON.
I encourage you to check out the GitHub repository to learn more about what's new in Chili 2.0. You'll find detailed documentation, examples, and installation instructions under the following link:
http://github.com/kodemore/chili
How it is different than pydantic? Chili is not a validation library, although it ensures type consistency. This gives it a huge perfomance advantage + easy interface with zero learning curve if you are already familiar with type annotations available in python.
And if you have any questions or feedback, please don't hesitate to reach out. I'd love to hear from you!
/r/Python
https://redd.it/12rkgoc
Hi Python enthusiasts!
I'm thrilled to announce the launch of Chili 2.0, a major update to my object serialization and deserialization library with JSON support. After 2 years of development, I'm excited to share this new version with the Python community.
Chili is a Python library that makes it easy to serialize and deserialize any Python object to and from dict and/or JSON.
I encourage you to check out the GitHub repository to learn more about what's new in Chili 2.0. You'll find detailed documentation, examples, and installation instructions under the following link:
http://github.com/kodemore/chili
How it is different than pydantic? Chili is not a validation library, although it ensures type consistency. This gives it a huge perfomance advantage + easy interface with zero learning curve if you are already familiar with type annotations available in python.
And if you have any questions or feedback, please don't hesitate to reach out. I'd love to hear from you!
/r/Python
https://redd.it/12rkgoc
GitHub
GitHub - kodemore/chili: Object serialization/deserialization tools for python.
Object serialization/deserialization tools for python. - kodemore/chili
Best way to organize Django Channels code?
In Django, I usually create a file called a "services" file. The entire business logic sits in this services file. Whenever a request comes the flow will be "urls.py -> views.py -> services.py". My views.py just calls the services.py file and it also handles the exceptions that I throw from the service function.
I've been exploring Django Channels for the last few days and I'm trying to build a chat app. Here I have a consumers.py file and I put the entire chat logic in the class "ChatConsumer". I don't know if this is the best approach. Most of the Django Channels tutorials and examples are just putting the entire logic in one class. What's the best way to organize the code?
I'm thinking of using a services file here as well and then move the entire logic to the services file. Not sure if this is the best approach. Please suggest a good way to organize the Django Channels code.
/r/django
https://redd.it/12ri12u
In Django, I usually create a file called a "services" file. The entire business logic sits in this services file. Whenever a request comes the flow will be "urls.py -> views.py -> services.py". My views.py just calls the services.py file and it also handles the exceptions that I throw from the service function.
I've been exploring Django Channels for the last few days and I'm trying to build a chat app. Here I have a consumers.py file and I put the entire chat logic in the class "ChatConsumer". I don't know if this is the best approach. Most of the Django Channels tutorials and examples are just putting the entire logic in one class. What's the best way to organize the code?
I'm thinking of using a services file here as well and then move the entire logic to the services file. Not sure if this is the best approach. Please suggest a good way to organize the Django Channels code.
/r/django
https://redd.it/12ri12u
Reddit
r/django on Reddit: Best way to organize Django Channels code?
Posted by u/God-of-war-2022 - 6 votes and 2 comments
Web Scraping With Python(2023) - A Complete Guide
https://serpdog.io/blog/web-scraping-with-python/
/r/Python
https://redd.it/12s6bt8
https://serpdog.io/blog/web-scraping-with-python/
/r/Python
https://redd.it/12s6bt8
scrapingdog
Comprehensive Guide on Web Scraping with Python
This guide is a full guide for someone who want to learn web scraping with Python. We have used 8 libraries to demonstrate scraping with live examples.
Jupyter Notebooks 7 Migration Plan
Hi Jupyter family, I would like to migrate over to Jupyter Notebook v7 as detailed in their migration plan (https://jupyter-notebook.readthedocs.io/en/latest/migrate\_to\_notebook7.html). Not going to lie, I have a degree in CS and I still do not understand what I need to do in-order to get jupyter-notebook 7 up and running in my 'data-science' env. The guide is both verbose and overly complicated (opinion) for simple folk like me. Can someone please ELI5 how to install it and get it up and running please?
/r/JupyterNotebooks
https://redd.it/12s3von
Hi Jupyter family, I would like to migrate over to Jupyter Notebook v7 as detailed in their migration plan (https://jupyter-notebook.readthedocs.io/en/latest/migrate\_to\_notebook7.html). Not going to lie, I have a degree in CS and I still do not understand what I need to do in-order to get jupyter-notebook 7 up and running in my 'data-science' env. The guide is both verbose and overly complicated (opinion) for simple folk like me. Can someone please ELI5 how to install it and get it up and running please?
/r/JupyterNotebooks
https://redd.it/12s3von
Reddit
r/JupyterNotebooks on Reddit: Jupyter Notebooks 7 Migration Plan
Posted by u/Chayalbodedd - 1 vote and 1 comment
In DRF do you validate your query params, if so how?
I know "how?" part bit generic question but let's say you have an student & school API and depending on the uuid you are doing some filtering which directly goes to ORM and if the query param is not valid UUID API will give 500.
However, I also don't recognize query params being validated much, especially like serializers.
I have to validate it but I also don't know what would be the best practices to achieve this?
/r/django
https://redd.it/12rspek
I know "how?" part bit generic question but let's say you have an student & school API and depending on the uuid you are doing some filtering which directly goes to ORM and if the query param is not valid UUID API will give 500.
However, I also don't recognize query params being validated much, especially like serializers.
I have to validate it but I also don't know what would be the best practices to achieve this?
/r/django
https://redd.it/12rspek
Reddit
r/django on Reddit: In DRF do you validate your query params, if so how?
Posted by u/Mr_Lkn - 11 votes and 23 comments