Security by fragility
So one of our websites got attacked today. Not a critical website,
Certain pages that require a secret 8-character alphanumeric code were being called thousands of times a minute.
This could have been a problem.
But thanks to my trusty SQLite3 database and literally zero optimisations anywhere, my server dutifully went down in minutes.
And so the hacker was not able to retrieve any valuable information.
And now we implemented some basic defenses.
Can't get hacked if your site's crashed !
/r/django
https://redd.it/1gzsjtv
So one of our websites got attacked today. Not a critical website,
Certain pages that require a secret 8-character alphanumeric code were being called thousands of times a minute.
This could have been a problem.
But thanks to my trusty SQLite3 database and literally zero optimisations anywhere, my server dutifully went down in minutes.
And so the hacker was not able to retrieve any valuable information.
And now we implemented some basic defenses.
Can't get hacked if your site's crashed !
/r/django
https://redd.it/1gzsjtv
Reddit
From the django community on Reddit
Explore this post and more from the django community
nxt-python and pyusb on OpenSuse Linux
I have a mindstorm NXT lying around in the house that my kinds used for school several years ago. I tought of interfacing it with python. I downloaded the nxt-python. It uses pyusb. When I tested it out with the tutorial from [https://ni.srht.site/nxt-python/latest/handbook/tutorial.html](https://ni.srht.site/nxt-python/latest/handbook/tutorial.html) and tried to locate the device using the following code:
#!/usr/bin/python3
"""NXT-Python tutorial: use touch sensor."""
import time
import nxt.locator
import nxt.sensor
import nxt.sensor.generic
with nxt.locator.find() as b:
# Get the sensor connected to port 1, not a digital sensor, must give the sensor
# class.
mysensor = b.get_sensor(nxt.sensor.Port.S1, nxt.sensor.generic.Touch)
# Read the sensor in a loop (until interrupted).
print("Use Ctrl-C to interrupt")
while True:
/r/Python
https://redd.it/1gztwtn
I have a mindstorm NXT lying around in the house that my kinds used for school several years ago. I tought of interfacing it with python. I downloaded the nxt-python. It uses pyusb. When I tested it out with the tutorial from [https://ni.srht.site/nxt-python/latest/handbook/tutorial.html](https://ni.srht.site/nxt-python/latest/handbook/tutorial.html) and tried to locate the device using the following code:
#!/usr/bin/python3
"""NXT-Python tutorial: use touch sensor."""
import time
import nxt.locator
import nxt.sensor
import nxt.sensor.generic
with nxt.locator.find() as b:
# Get the sensor connected to port 1, not a digital sensor, must give the sensor
# class.
mysensor = b.get_sensor(nxt.sensor.Port.S1, nxt.sensor.generic.Touch)
# Read the sensor in a loop (until interrupted).
print("Use Ctrl-C to interrupt")
while True:
/r/Python
https://redd.it/1gztwtn
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Deploying Flask-based Microservices on AWS with ECS Service Connect
The playlist is broken into six parts:
1. An introduction to ECS Service Connect and the various AWS components that will be used
2. Run the flask-based microservice architecture locally before diving into AWS
3. Get the flask-based microservice architecture **just working** on AWS. We'll rely on a lot of the defaults provided by AWS on the networking to get a working example quickly that you can see in action on AWS
4. We'll do the same as the previous video, but not rely on default networking setup by AWS. We'll configure networking ourselves with the recommended AWS approach so the app is production-ready
5. Use GitHub Actions to automate deployments to our flask app code running on our microservice architecture on AWS
6. Run a CDK (Cloud Development Kit) noscript that will create both the AWS networking components, as well as the ECS components. After running the noscript with a single `cdk deploy --all` command, the microservice architecture will be fully functional
This tutorial truly is end-to-end. If you enjoy the content, you can help me a ton by doing any or all of the following:
[supporting me on Patreon](https://www.patreon.com/programmingwithalex)
subscribing to my YouTube channel
liking and/or commenting on the videos
sharing the video(s) or channel on any
/r/flask
https://redd.it/1gzmk8u
The playlist is broken into six parts:
1. An introduction to ECS Service Connect and the various AWS components that will be used
2. Run the flask-based microservice architecture locally before diving into AWS
3. Get the flask-based microservice architecture **just working** on AWS. We'll rely on a lot of the defaults provided by AWS on the networking to get a working example quickly that you can see in action on AWS
4. We'll do the same as the previous video, but not rely on default networking setup by AWS. We'll configure networking ourselves with the recommended AWS approach so the app is production-ready
5. Use GitHub Actions to automate deployments to our flask app code running on our microservice architecture on AWS
6. Run a CDK (Cloud Development Kit) noscript that will create both the AWS networking components, as well as the ECS components. After running the noscript with a single `cdk deploy --all` command, the microservice architecture will be fully functional
This tutorial truly is end-to-end. If you enjoy the content, you can help me a ton by doing any or all of the following:
[supporting me on Patreon](https://www.patreon.com/programmingwithalex)
subscribing to my YouTube channel
liking and/or commenting on the videos
sharing the video(s) or channel on any
/r/flask
https://redd.it/1gzmk8u
YouTube
Microservices on AWS with ECS Service Connect - Part 1: Introduction
Please consider supporting me on Patreon: https://www.patreon.com/programmingwithalex
GitHub link: https://github.com/programmingwithalex/aws_ecs_service_connect
00:00 - Intro
01:13 - What are microservices?
02:21 - What is Service Connect?
02:46 - Series…
GitHub link: https://github.com/programmingwithalex/aws_ecs_service_connect
00:00 - Intro
01:13 - What are microservices?
02:21 - What is Service Connect?
02:46 - Series…
Tuesday Daily Thread: Advanced questions
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1gzy1hi
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1gzy1hi
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. | 413614 members
" cannot import name 'views' from 'mysite' "
Am at the 3rd page of Django - Build your own app tutorial at this very part, and I cannot access "/polls/34/" because it shows :
> from . import views
ImportError: cannot import name 'views' from 'mysite' (C:\\Users\\XXYY\\djangotutorial\\mysite\\__init__.py)
How do I fix it?
/r/djangolearning
https://redd.it/1gzec8n
Am at the 3rd page of Django - Build your own app tutorial at this very part, and I cannot access "/polls/34/" because it shows :
> from . import views
ImportError: cannot import name 'views' from 'mysite' (C:\\Users\\XXYY\\djangotutorial\\mysite\\__init__.py)
How do I fix it?
/r/djangolearning
https://redd.it/1gzec8n
Django Project
Writing your first Django app, part 3 | Django documentation
The web framework for perfectionists with deadlines.
First deployment VPS, docker
Clearly something went wrong here...
I try to deploy on hetzner vps using docker ce image. My site was up, but I look at it today and CPU was 100% usage, same for RAM, I couldn't even do anything in console.
I must have messed something up, it's my first deployment. Can you help me figure out why so many processes are duplicating and how to fix this?
My project is here: https://github.com/Pirat102/WebApp/tree/main
https://preview.redd.it/xjx9irfsp23e1.png?width=1233&format=png&auto=webp&s=255220411d1589e18acbd4a1264d366a9f62a2a6
https://preview.redd.it/zn2no2tvo23e1.png?width=1525&format=png&auto=webp&s=bb98d187279d19b2c4566a24cd41482fa250cfde
https://preview.redd.it/ygkvdwhyo23e1.png?width=1882&format=png&auto=webp&s=3b543c0a0e53d26f2eca0a7a0d54af52a1676661
/r/django
https://redd.it/1gznbx5
Clearly something went wrong here...
I try to deploy on hetzner vps using docker ce image. My site was up, but I look at it today and CPU was 100% usage, same for RAM, I couldn't even do anything in console.
I must have messed something up, it's my first deployment. Can you help me figure out why so many processes are duplicating and how to fix this?
My project is here: https://github.com/Pirat102/WebApp/tree/main
https://preview.redd.it/xjx9irfsp23e1.png?width=1233&format=png&auto=webp&s=255220411d1589e18acbd4a1264d366a9f62a2a6
https://preview.redd.it/zn2no2tvo23e1.png?width=1525&format=png&auto=webp&s=bb98d187279d19b2c4566a24cd41482fa250cfde
https://preview.redd.it/ygkvdwhyo23e1.png?width=1882&format=png&auto=webp&s=3b543c0a0e53d26f2eca0a7a0d54af52a1676661
/r/django
https://redd.it/1gznbx5
GitHub
GitHub - Pirat102/DevRadar
Contribute to Pirat102/DevRadar development by creating an account on GitHub.
Improving GroupBy.map with Dask and Xarray
I'm a Dask contributor and wanted to share some recent improvements on using Dask + Xarray for working with large geo datasets.
Over the past couple months, there's been more work on the array integration for Dask, with a focus on geospatial workloads. Running GroupBy-Map patterns backed by Dask arrays is essential for a number of tasks when working with large climate/weather data, like detrending or zonal averaging. The latest version of Dask uses a new algorithm for selecting data that’s more robust and we're already seeing improved performance.
We are actively working on improvements and are interested in feedback. Feel free to reach out and let us know if things aren't working for you.
Blog post: https://docs.coiled.io/blog/dask-detrending.html
/r/Python
https://redd.it/1gznukm
I'm a Dask contributor and wanted to share some recent improvements on using Dask + Xarray for working with large geo datasets.
Over the past couple months, there's been more work on the array integration for Dask, with a focus on geospatial workloads. Running GroupBy-Map patterns backed by Dask arrays is essential for a number of tasks when working with large climate/weather data, like detrending or zonal averaging. The latest version of Dask uses a new algorithm for selecting data that’s more robust and we're already seeing improved performance.
We are actively working on improvements and are interested in feedback. Feel free to reach out and let us know if things aren't working for you.
Blog post: https://docs.coiled.io/blog/dask-detrending.html
/r/Python
https://redd.it/1gznukm
Coiled
Improving GroupBy.map with Dask and Xarray
Patrick Hoefler 2024-11-21 4 min read This post was originally published on the Xarray blog. Running large-scale GroupBy-Map patterns with Xarray that are backed by Dask arrays is an essential part...
Flask session data is shared across multiple tabs
I create a variable and store it in flask session(server side), now I open another tab and change the variable, now it reflects in both the tabs. How should I deal with separating data accross multiple tabs?
/r/flask
https://redd.it/1h03ymy
I create a variable and store it in flask session(server side), now I open another tab and change the variable, now it reflects in both the tabs. How should I deal with separating data accross multiple tabs?
/r/flask
https://redd.it/1h03ymy
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Can Your Networking Library Do This
I've been using a networking library for a while and getting some value out it. Especially when I'm dealing with complex collections of process, i.e. distributed processing. It turns out that some wacky ideas actually work, and as far as I know, dont work with any other tools. Here is the repo;
Can your networking library do this
This repo demonstrates what you might do once you have OSI application layering and a pretty fresh approach to network addressing, i.e. not IPv4, IPv6 or socket id or request id or channel id.
Please find a link to a blog in the README that describes what to do with the modules. Does anyone claim that there is an equivalent, or better? Does anyone think that this kind of capability is missing from current toolsets?
/r/Python
https://redd.it/1h04rcp
I've been using a networking library for a while and getting some value out it. Especially when I'm dealing with complex collections of process, i.e. distributed processing. It turns out that some wacky ideas actually work, and as far as I know, dont work with any other tools. Here is the repo;
Can your networking library do this
This repo demonstrates what you might do once you have OSI application layering and a pretty fresh approach to network addressing, i.e. not IPv4, IPv6 or socket id or request id or channel id.
Please find a link to a blog in the README that describes what to do with the modules. Does anyone claim that there is an equivalent, or better? Does anyone think that this kind of capability is missing from current toolsets?
/r/Python
https://redd.it/1h04rcp
GitHub
GitHub - mr-ansar/can-your-networking-library-do-this: Modules for the blog article
Modules for the blog article. Contribute to mr-ansar/can-your-networking-library-do-this development by creating an account on GitHub.
Goal Screener (my first python app)
What My Project Does
it takes your quests/goals as main and side and a picture, then it simply draw them on it and make it the background picture so you can visualize your quests, besides that in the app you can see the list of your goals and track one of them.
Target Audience:
this project was meant for my own needs and to help some people boost their productivity to reach their goals
Comparison:
i really didn't look that much for comparison but i think there is some extensions or widget to do that especially on phone, no one draws on the background l think, the idea is that backgrounds let you see your goals more often that's why i did it this way
here's the link to the code github if anyone's interested, and remember to give me your feedback so i can develop my skills for future projects
/r/Python
https://redd.it/1h064ct
What My Project Does
it takes your quests/goals as main and side and a picture, then it simply draw them on it and make it the background picture so you can visualize your quests, besides that in the app you can see the list of your goals and track one of them.
Target Audience:
this project was meant for my own needs and to help some people boost their productivity to reach their goals
Comparison:
i really didn't look that much for comparison but i think there is some extensions or widget to do that especially on phone, no one draws on the background l think, the idea is that backgrounds let you see your goals more often that's why i did it this way
here's the link to the code github if anyone's interested, and remember to give me your feedback so i can develop my skills for future projects
/r/Python
https://redd.it/1h064ct
GitHub
GitHub - L4z3x/goal_screener: a simple python app built with pyqt and pillow to boost your production by visualzing your goals/quest…
a simple python app built with pyqt and pillow to boost your production by visualzing your goals/quest in the home background and tracking them - L4z3x/goal_screener
Generate a gradient between 2 colors in python.
Saving this here for future people. This method relies on a library i made called hueforge:
Installation: pip install hueforge
Code:
from hueforge import Color
startingcolor = Color('red') # You can use other color formats. to see all check the readme file
endingcolor = Color('orange red')
print(startingcolor.gradient(to=endingcolor, steps=5))
/r/Python
https://redd.it/1gzdra0
Saving this here for future people. This method relies on a library i made called hueforge:
Installation: pip install hueforge
Code:
from hueforge import Color
startingcolor = Color('red') # You can use other color formats. to see all check the readme file
endingcolor = Color('orange red')
print(startingcolor.gradient(to=endingcolor, steps=5))
/r/Python
https://redd.it/1gzdra0
GitHub
GitHub - thearchcoder/Hueforge
Contribute to thearchcoder/Hueforge development by creating an account on GitHub.
What are some of the best Django project ideas to work
Hi everyone,
I'm looking to expand my Django skills and wanted to ask the community for suggestions. What are some of the best Django projects for learning or improving your development skills? I'm open to both beginner and intermediate level projects, but ideally, I want something that will help me practice important concepts like authentication, databases, and building full-stack web apps.
I'm looking for ideas that will challenge me while also being fun and useful to build. Any project suggestions or resources to get started would be greatly appreciated!
Thanks in advance!
/r/django
https://redd.it/1h0419d
Hi everyone,
I'm looking to expand my Django skills and wanted to ask the community for suggestions. What are some of the best Django projects for learning or improving your development skills? I'm open to both beginner and intermediate level projects, but ideally, I want something that will help me practice important concepts like authentication, databases, and building full-stack web apps.
I'm looking for ideas that will challenge me while also being fun and useful to build. Any project suggestions or resources to get started would be greatly appreciated!
Thanks in advance!
/r/django
https://redd.it/1h0419d
Reddit
From the django community on Reddit
Explore this post and more from the django community
Sou iniciante n mundo da progrmação
O que vocês que já tem mais experiência acham que deve estudar e por onde devo começar no estudo de Python. Se possível indique conteudo de leitura.
/r/Python
https://redd.it/1h0aomx
O que vocês que já tem mais experiência acham que deve estudar e por onde devo começar no estudo de Python. Se possível indique conteudo de leitura.
/r/Python
https://redd.it/1h0aomx
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
A blog project made with Wagtail CMS turned into one of the coolest coding experiences of my life!
Not too long ago, I fell in love with Django. It made creating websites feel like working on a fun Lego project without having to buy the actual Lego set, and without having to clean up after. I started making YT coding tutorials to give myself more excuses to code, and because explaining what I do out loud helped me learn better, and sharing what I love with others feels great, like I am part of a community.
At some point, someone I know noticed I loved to code and asked me to build them a blog site. I said "I am on it, totally!" But also, I was quietly panicking because I’d never made a blog before and hadn’t coded anything that involved a Content Management System in my life. Then I remembered seeing Wagtail CMS mentioned here on the Django Subreddit a few times. I figured, Why not give this a shot? So I jumped into Wagtail’s getting-started tutorial without overthinking it.
And you know what? Wagtail turned out to be so intuitive that I felt like I “got it” within a few hours. I was expecting it to take weeks, maybe even a month. I couldn’t believe it! I
/r/django
https://redd.it/1h0es4y
Not too long ago, I fell in love with Django. It made creating websites feel like working on a fun Lego project without having to buy the actual Lego set, and without having to clean up after. I started making YT coding tutorials to give myself more excuses to code, and because explaining what I do out loud helped me learn better, and sharing what I love with others feels great, like I am part of a community.
At some point, someone I know noticed I loved to code and asked me to build them a blog site. I said "I am on it, totally!" But also, I was quietly panicking because I’d never made a blog before and hadn’t coded anything that involved a Content Management System in my life. Then I remembered seeing Wagtail CMS mentioned here on the Django Subreddit a few times. I figured, Why not give this a shot? So I jumped into Wagtail’s getting-started tutorial without overthinking it.
And you know what? Wagtail turned out to be so intuitive that I felt like I “got it” within a few hours. I was expecting it to take weeks, maybe even a month. I couldn’t believe it! I
/r/django
https://redd.it/1h0es4y
Reddit
From the django community on Reddit: A blog project made with Wagtail CMS turned into one of the coolest coding experiences of…
Explore this post and more from the django community
I made a Report Generation and Project Management Tool Django Rest
Hi, I recently released my open-source project APTRS (Automated Penetration Testing Reporting System). It is an automated pentest report generation application built with the Django Rest framework.
What it does:
Enables users to create and manage projects while tracking their statuses.
Management of customers and their respective projects, as well as any associated security vulnerabilities.
Users can generate project reports in Word using a custom template, as well as in PDF and Excel formats.
Additionally, the application allows users to use the WYSIWYG CKEDITOR to input data and document vulnerabilities for report creation.
Target Audience:
Individual Security Consultant
Cyber Security Companies to manage projects and clients and create a report
Many similar tools exist, but most Python-based options do not support custom word templates. APTRS stands out by focusing on company needs with features for project management and status tracking. It also plans to introduce customer login functionality, a feature lacking in other open-source tools.
Tech Stack:
Python 3.9+ with Django Rest Framework
Postgresql
Redis
Vite + React Frontend
Here's the source: APTRS
In case you're interested, I have demo instances hosted in the cloud available at: https://live.aptrs.com/ (Default creds are sourav.kalal@aptrs.com & I-am-Weak-Password-Please-Change-Me) - Some APIs
/r/Python
https://redd.it/1h0g0us
Hi, I recently released my open-source project APTRS (Automated Penetration Testing Reporting System). It is an automated pentest report generation application built with the Django Rest framework.
What it does:
Enables users to create and manage projects while tracking their statuses.
Management of customers and their respective projects, as well as any associated security vulnerabilities.
Users can generate project reports in Word using a custom template, as well as in PDF and Excel formats.
Additionally, the application allows users to use the WYSIWYG CKEDITOR to input data and document vulnerabilities for report creation.
Target Audience:
Individual Security Consultant
Cyber Security Companies to manage projects and clients and create a report
Many similar tools exist, but most Python-based options do not support custom word templates. APTRS stands out by focusing on company needs with features for project management and status tracking. It also plans to introduce customer login functionality, a feature lacking in other open-source tools.
Tech Stack:
Python 3.9+ with Django Rest Framework
Postgresql
Redis
Vite + React Frontend
Here's the source: APTRS
In case you're interested, I have demo instances hosted in the cloud available at: https://live.aptrs.com/ (Default creds are sourav.kalal@aptrs.com & I-am-Weak-Password-Please-Change-Me) - Some APIs
/r/Python
https://redd.it/1h0g0us
GitHub
GitHub - APTRS/APTRS: Automated pentest reporting with custom templates, project tracking, customer dashboard and client management…
Automated pentest reporting with custom templates, project tracking, customer dashboard and client management tools. Streamline your security workflows effortlessly! - APTRS/APTRS
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/1h0qsi6
# 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/1h0qsi6
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. | 413614 members
Anybody else all the sudden unable to access Python downloads at python.org?
We have a number of jobs that download python distros from python.org/ftp, and they just started failing due to Access Denied errors. Anybody else seeing this? Is this intentional? Everything in https://www.python.org/downloads/source/ is going to Access Denied
edit: Either python.org got ransomeware'd or some admin pushed a bad config change. Could be infra issues too I suppose. Looks like that backlog card for saving a copy of the source for the versions we use to S3 and pulling from there just got moved to this sprint...
Issue here for tracking - https://github.com/python/cpython/issues/127307
edit edit: looks like it's back up again
/r/Python
https://redd.it/1h0opoj
We have a number of jobs that download python distros from python.org/ftp, and they just started failing due to Access Denied errors. Anybody else seeing this? Is this intentional? Everything in https://www.python.org/downloads/source/ is going to Access Denied
edit: Either python.org got ransomeware'd or some admin pushed a bad config change. Could be infra issues too I suppose. Looks like that backlog card for saving a copy of the source for the versions we use to S3 and pulling from there just got moved to this sprint...
Issue here for tracking - https://github.com/python/cpython/issues/127307
edit edit: looks like it's back up again
/r/Python
https://redd.it/1h0opoj
Python.org
Python Source Releases for Source release
The official home of the Python Programming Language
Localization in Django Rest Framework
I have a Django Rest Framework project that is handling REST apis and React + TS application for client side.
Now I need to add Localization to my application for multi language support and it needs to be done on server side, so that the strings can be changed from the admin panel easily. I have used i18n on client side in React before but we want to do it on server side.
What's the best way to handle this? I am going through the documentation: https://docs.djangoproject.com/en/5.1/topics/i18n/translation/ & https://www.django-rest-framework.org/topics/internationalization/ but can't wrap my head around it how will be handled on the client side in React? Everything need to be translated from Header to Footer and everything in between.
Thanks!
/r/django
https://redd.it/1h0xm0r
I have a Django Rest Framework project that is handling REST apis and React + TS application for client side.
Now I need to add Localization to my application for multi language support and it needs to be done on server side, so that the strings can be changed from the admin panel easily. I have used i18n on client side in React before but we want to do it on server side.
What's the best way to handle this? I am going through the documentation: https://docs.djangoproject.com/en/5.1/topics/i18n/translation/ & https://www.django-rest-framework.org/topics/internationalization/ but can't wrap my head around it how will be handled on the client side in React? Everything need to be translated from Header to Footer and everything in between.
Thanks!
/r/django
https://redd.it/1h0xm0r
Django Project
Translation | Django documentation
The web framework for perfectionists with deadlines.
Am stuck at part 3 of Django - Writing your own app.
So at this part, I try to type in /polls/34 and get this response:
# Page not found (404)
|Request Method:|GET|
|:-|:-|
|Request URL:|http://127.0.0.1:8000/polls/34|
Using the URLconf defined in
1.
2.
3.
4.
The current path,
Why is that?
/r/djangolearning
https://redd.it/1h0yaq5
So at this part, I try to type in /polls/34 and get this response:
# Page not found (404)
|Request Method:|GET|
|:-|:-|
|Request URL:|http://127.0.0.1:8000/polls/34|
Using the URLconf defined in
mysite.urls, Django tried these URL patterns, in this order:1.
[name='index']2.
<int:question_id>/ [name='detail']3.
<int:question_id>/results/ [name='results']4.
<int:question_id>/vote/ [name='vote']The current path,
polls/34, didn’t match any of these.Why is that?
/r/djangolearning
https://redd.it/1h0yaq5
Django Project
Writing your first Django app, part 3 | Django documentation
The web framework for perfectionists with deadlines.
is 2depth nested model still good for production..?
hi, I am building an ecommerce and my model structures are like
Product - < OptionName -< OptionValue
2depth nested model, and I feel it is really difficult to handle create, update in drf serializer.. is 2depth a normal approach? or should I limit to 1depth?
also, any advice or ways to handle nested models for creations and updating?
/r/django
https://redd.it/1h10yki
hi, I am building an ecommerce and my model structures are like
Product - < OptionName -< OptionValue
2depth nested model, and I feel it is really difficult to handle create, update in drf serializer.. is 2depth a normal approach? or should I limit to 1depth?
also, any advice or ways to handle nested models for creations and updating?
/r/django
https://redd.it/1h10yki
Reddit
From the django community on Reddit
Explore this post and more from the django community
Is there life beyond PyUnit/PyTest?
Some years ago, there were many alternatives to just using these: grappa, behave, for instance, with many less-popular alternatives around and thriving.
Today, if you check Snyk Advisor for these, or simply the repo, you will find them abandoned or worse, with security issues. To be sure, checking the Assertions category in Pypi will give you some alternatives, a few interesting ones based in a fluent API, for instance, but none of them are even remotely as popular as these ones. New tutorials don't even bother in telling people to look for alternatives.
Have we arrived to a point where Python is so mature that a single framework is enough to test it all?
/r/Python
https://redd.it/1h0yg58
Some years ago, there were many alternatives to just using these: grappa, behave, for instance, with many less-popular alternatives around and thriving.
Today, if you check Snyk Advisor for these, or simply the repo, you will find them abandoned or worse, with security issues. To be sure, checking the Assertions category in Pypi will give you some alternatives, a few interesting ones based in a fluent API, for instance, but none of them are even remotely as popular as these ones. New tutorials don't even bother in telling people to look for alternatives.
Have we arrived to a point where Python is so mature that a single framework is enough to test it all?
/r/Python
https://redd.it/1h0yg58
PyPI
behave
behave is behaviour-driven development, Python style