React-Django Deployment
I have been working on Ngnix and Gunicorn the whole day and no luck. It's crazy. Both backend and frontend have deployed successfully but while trying to access the backend from the browser I get no response. I need help with configuration. Any leads?
/r/djangolearning
https://redd.it/1gsv99j
I have been working on Ngnix and Gunicorn the whole day and no luck. It's crazy. Both backend and frontend have deployed successfully but while trying to access the backend from the browser I get no response. I need help with configuration. Any leads?
/r/djangolearning
https://redd.it/1gsv99j
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Write any Python noscript in 30 characters (plus an ungodly amount of whitespace)
Hey all!
My friend challenged me to find the shortest solution to a certain Leetcode-style problem in Python. They were generous enough to let me use whitespace for free, so that the code stays readable.
# What My Project Does
I like abusing rules, so I made a tool to encode any Python noscript in just 30 bytes, plus some a lot of whitespace.
This result is somewhat harder to achieve than it looks like at first, so you might want to check out a post I wrote about it. Alternatively, jump straight to the code if that's more of your thing: GitHub.
# Target Audience
This is a toy project, nothing serious, but it was fun for me to work on. I hope you find it entertaining too!
# Comparison
This is honestly the first time I've seen anyone do this with a specific goal of reducing the number of non-whitespace characters at any cost, so this might as well be a unique project.
As a honorary mention, though, it builds on another project I think deserves recognition: PyFuck. It's JSFuck for Python, using 8 different characters to encode any (short enough) Python program.
/r/Python
https://redd.it/1gsyls8
Hey all!
My friend challenged me to find the shortest solution to a certain Leetcode-style problem in Python. They were generous enough to let me use whitespace for free, so that the code stays readable.
# What My Project Does
I like abusing rules, so I made a tool to encode any Python noscript in just 30 bytes, plus some a lot of whitespace.
This result is somewhat harder to achieve than it looks like at first, so you might want to check out a post I wrote about it. Alternatively, jump straight to the code if that's more of your thing: GitHub.
# Target Audience
This is a toy project, nothing serious, but it was fun for me to work on. I hope you find it entertaining too!
# Comparison
This is honestly the first time I've seen anyone do this with a specific goal of reducing the number of non-whitespace characters at any cost, so this might as well be a unique project.
As a honorary mention, though, it builds on another project I think deserves recognition: PyFuck. It's JSFuck for Python, using 8 different characters to encode any (short enough) Python program.
/r/Python
https://redd.it/1gsyls8
purplesyringa's blog
Any Python program fits in 24 characters*
* If you don’t take whitespace into account.
My friend challenged me to find the shortest solution to a certain Leetcode-style problem in Python. They were generous enough to let me use whitespace for free, so that the code stays readable. So that’s exactly…
My friend challenged me to find the shortest solution to a certain Leetcode-style problem in Python. They were generous enough to let me use whitespace for free, so that the code stays readable. So that’s exactly…
AnyModal: A Python Framework for Multimodal LLMs
[AnyModal](https://github.com/ritabratamaiti/AnyModal) is a modular and extensible framework for integrating diverse input modalities (e.g., images, audio) into large language models (LLMs). It enables seamless tokenization, encoding, and language generation using pre-trained models for various modalities.
### Why I Built AnyModal
I created AnyModal to address a gap in existing resources for designing vision-language models (VLMs) or other multimodal LLMs. While there are excellent tools for specific tasks, there wasn’t a cohesive framework for easily combining different input types with LLMs. AnyModal aims to fill that gap by simplifying the process of adding new input processors and tokenizers while leveraging the strengths of pre-trained language models.
### Features
- **Modular Design**: Plug and play with different modalities like vision, audio, or custom data types.
- **Ease of Use**: Minimal setup—just implement your modality-specific tokenization and pass it to the framework.
- **Extensibility**: Add support for new modalities with only a few lines of code.
### Example Usage
```python
from transformers import ViTImageProcessor, ViTForImageClassification
from anymodal import MultiModalModel
from vision import VisionEncoder, Projector
# Load vision processor and model
processor = ViTImageProcessor.from_pretrained('google/vit-base-patch16-224')
vision_model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224')
hidden_size = vision_model.config.hidden_size
# Initialize vision encoder and projector
vision_encoder = VisionEncoder(vision_model)
vision_tokenizer = Projector(in_features=hidden_size, out_features=768)
# Load LLM components
from transformers import AutoTokenizer, AutoModelForCausalLM
llm_tokenizer = AutoTokenizer.from_pretrained("gpt2")
llm_model = AutoModelForCausalLM.from_pretrained("gpt2")
# Initialize AnyModal
multimodal_model = MultiModalModel(
input_processor=None,
/r/Python
https://redd.it/1gtbrzb
[AnyModal](https://github.com/ritabratamaiti/AnyModal) is a modular and extensible framework for integrating diverse input modalities (e.g., images, audio) into large language models (LLMs). It enables seamless tokenization, encoding, and language generation using pre-trained models for various modalities.
### Why I Built AnyModal
I created AnyModal to address a gap in existing resources for designing vision-language models (VLMs) or other multimodal LLMs. While there are excellent tools for specific tasks, there wasn’t a cohesive framework for easily combining different input types with LLMs. AnyModal aims to fill that gap by simplifying the process of adding new input processors and tokenizers while leveraging the strengths of pre-trained language models.
### Features
- **Modular Design**: Plug and play with different modalities like vision, audio, or custom data types.
- **Ease of Use**: Minimal setup—just implement your modality-specific tokenization and pass it to the framework.
- **Extensibility**: Add support for new modalities with only a few lines of code.
### Example Usage
```python
from transformers import ViTImageProcessor, ViTForImageClassification
from anymodal import MultiModalModel
from vision import VisionEncoder, Projector
# Load vision processor and model
processor = ViTImageProcessor.from_pretrained('google/vit-base-patch16-224')
vision_model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224')
hidden_size = vision_model.config.hidden_size
# Initialize vision encoder and projector
vision_encoder = VisionEncoder(vision_model)
vision_tokenizer = Projector(in_features=hidden_size, out_features=768)
# Load LLM components
from transformers import AutoTokenizer, AutoModelForCausalLM
llm_tokenizer = AutoTokenizer.from_pretrained("gpt2")
llm_model = AutoModelForCausalLM.from_pretrained("gpt2")
# Initialize AnyModal
multimodal_model = MultiModalModel(
input_processor=None,
/r/Python
https://redd.it/1gtbrzb
GitHub
GitHub - ritabratamaiti/AnyModal: AnyModal is a Flexible Multimodal Language Model Framework for PyTorch
AnyModal is a Flexible Multimodal Language Model Framework for PyTorch - ritabratamaiti/AnyModal
Why is my django-cte manager a lot faster than a custom QuerySet?
I have this Car model that I want to sort by speed. I implemented two different ways to do these: one is by using a custom queryset and the other is using an external package using django-cte (see below). For some reason, the CTE implementation is alot faster even though the queries are the same (same limit, same offset, same filters, ...). And I'm talking tens of magnitude better, since for 1 million records the custom queryset runs for approx 21s while the CTE one is running for 2s only. Why is this happening? Is it because the custom queryset is sorting it first then does the necessary filters?
```
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_cte import CTEManager, With
class CarCTEManager(CTEManager):
def sort_speed(self):
cte = With(
Car.objects.annotate(
rank=models.Window(
expression=models.functions.Rank(),
/r/django
https://redd.it/1gt9q67
I have this Car model that I want to sort by speed. I implemented two different ways to do these: one is by using a custom queryset and the other is using an external package using django-cte (see below). For some reason, the CTE implementation is alot faster even though the queries are the same (same limit, same offset, same filters, ...). And I'm talking tens of magnitude better, since for 1 million records the custom queryset runs for approx 21s while the CTE one is running for 2s only. Why is this happening? Is it because the custom queryset is sorting it first then does the necessary filters?
```
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_cte import CTEManager, With
class CarCTEManager(CTEManager):
def sort_speed(self):
cte = With(
Car.objects.annotate(
rank=models.Window(
expression=models.functions.Rank(),
/r/django
https://redd.it/1gt9q67
Reddit
From the django community on Reddit
Explore this post and more from the django community
Deply: keep your python architecture clean
Hello everyone,
My name is Archil. I'm a Python/PHP developer originally from Ukraine, now living in Wrocław, Poland. I've been working on a tool called [Deply](https://github.com/Vashkatsi/deply), and I'd love to get your feedback and thoughts on it.
# What My Project Does
**Deply** is a standalone Python tool designed to enforce architectural patterns and dependencies in large Python projects. Deply analyzes your code structure and dependencies to ensure that architectural rules are followed. This promotes cleaner, more maintainable, and modular codebases.
**Key Features:**
* **Layer-Based Analysis**: Define custom layers (e.g., models, views, services) and restrict their dependencies.
* **Dynamic Configuration**: Easily configure collectors for each layer using file patterns and class inheritance.
* **CI Integration**: Integrate Deply into your Continuous Integration pipeline to automatically detect and prevent architecture violations before they reach production.
# Target Audience
* **Who It's For**: Developers and teams working on medium to large Python projects who want to maintain a clean architecture.
* **Intended Use**: Ideal for production environments where enforcing module boundaries is critical, as well as educational purposes to teach best practices.
# Use Cases
* **Continuous Integration**: Add Deply to your CI/CD pipeline to catch architectural violations early in the development process.
* **Refactoring**: Use Deply to understand existing dependencies in your codebase, making large-scale
/r/Python
https://redd.it/1gthdpy
Hello everyone,
My name is Archil. I'm a Python/PHP developer originally from Ukraine, now living in Wrocław, Poland. I've been working on a tool called [Deply](https://github.com/Vashkatsi/deply), and I'd love to get your feedback and thoughts on it.
# What My Project Does
**Deply** is a standalone Python tool designed to enforce architectural patterns and dependencies in large Python projects. Deply analyzes your code structure and dependencies to ensure that architectural rules are followed. This promotes cleaner, more maintainable, and modular codebases.
**Key Features:**
* **Layer-Based Analysis**: Define custom layers (e.g., models, views, services) and restrict their dependencies.
* **Dynamic Configuration**: Easily configure collectors for each layer using file patterns and class inheritance.
* **CI Integration**: Integrate Deply into your Continuous Integration pipeline to automatically detect and prevent architecture violations before they reach production.
# Target Audience
* **Who It's For**: Developers and teams working on medium to large Python projects who want to maintain a clean architecture.
* **Intended Use**: Ideal for production environments where enforcing module boundaries is critical, as well as educational purposes to teach best practices.
# Use Cases
* **Continuous Integration**: Add Deply to your CI/CD pipeline to catch architectural violations early in the development process.
* **Refactoring**: Use Deply to understand existing dependencies in your codebase, making large-scale
/r/Python
https://redd.it/1gthdpy
GitHub
GitHub - Vashkatsi/deply: Keep your python architecture clean.
Keep your python architecture clean. Contribute to Vashkatsi/deply development by creating an account on GitHub.
Best host for webapp?
I have a web app running flask login, sqlalchemy for the db, and react for frontend. Don't particulalry want to spend more than 10-20€ (based in western europe) a month, but I do want the option to allow for expansion if the website starts getting traction. I've looked around and there are so many options it's giving me a bit of a headache.
AWS elastic beanstalk seems like the obvious innitial choice, but I feel like the price can really balloon after the first year from what I've read. I've heared about other places to host but nothing seemed to stand out yet.
Idk if this is relevant for the choice, but OVH is my registrar, I'm not really considering them as I've heared it's a bit of a nightmare to host on.
/r/flask
https://redd.it/1gtk0wa
I have a web app running flask login, sqlalchemy for the db, and react for frontend. Don't particulalry want to spend more than 10-20€ (based in western europe) a month, but I do want the option to allow for expansion if the website starts getting traction. I've looked around and there are so many options it's giving me a bit of a headache.
AWS elastic beanstalk seems like the obvious innitial choice, but I feel like the price can really balloon after the first year from what I've read. I've heared about other places to host but nothing seemed to stand out yet.
Idk if this is relevant for the choice, but OVH is my registrar, I'm not really considering them as I've heared it's a bit of a nightmare to host on.
/r/flask
https://redd.it/1gtk0wa
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
I started implementing an AsyncIO event loop in Rust
The project is called *RLoop* and available [in the relevant GH repository](https://github.com/gi0baro/rloop).
# What My Project Does
RLoop is intended to be a 1:1 replacement for the standard library asyncio event loop. At the moment RLoop is still very pre-alpha, as it only supports I/O handles involving raw socket file denoscriptors. The aim is to reach a stable and feature-complete release in the next few months.
# Target Audience
RLoop is intended for every `asyncio` developer. Until the project reach a stable state though, is intended for use only in non-production environments and for testing purposes only.
# Comparison to Existing Alternatives
The main existing alternatives to RLoop are the standard library implementation and `uvloop`.
Aside from the lack of features of RLoop at this stage, some preliminary benchmarks on MacOS and Python 3.11 with a basic TCP echo show a 30% gain over the default `asyncio` implementation, while `uvloop` is still 50% faster.
___
Feel free to post your feedbacks, test RLoop within your environment and contribute :)
/r/Python
https://redd.it/1gtmvdb
The project is called *RLoop* and available [in the relevant GH repository](https://github.com/gi0baro/rloop).
# What My Project Does
RLoop is intended to be a 1:1 replacement for the standard library asyncio event loop. At the moment RLoop is still very pre-alpha, as it only supports I/O handles involving raw socket file denoscriptors. The aim is to reach a stable and feature-complete release in the next few months.
# Target Audience
RLoop is intended for every `asyncio` developer. Until the project reach a stable state though, is intended for use only in non-production environments and for testing purposes only.
# Comparison to Existing Alternatives
The main existing alternatives to RLoop are the standard library implementation and `uvloop`.
Aside from the lack of features of RLoop at this stage, some preliminary benchmarks on MacOS and Python 3.11 with a basic TCP echo show a 30% gain over the default `asyncio` implementation, while `uvloop` is still 50% faster.
___
Feel free to post your feedbacks, test RLoop within your environment and contribute :)
/r/Python
https://redd.it/1gtmvdb
GitHub
GitHub - gi0baro/rloop: An AsyncIO event loop implemented in Rust
An AsyncIO event loop implemented in Rust. Contribute to gi0baro/rloop development by creating an account on GitHub.
Jupyter Enterprise Gateway on Windows Server?
Hi,
I try to run JEG on my windows server 2019 to connect my laptop to the kernels on the server.
Connection works fine, kernels are starting but closing after WebSocket timeout.
Here is what I can see in the JEG console
D 2024-11-17 18:54:53.267 EnterpriseGatewayApp] Launching kernel: 'Python 3 (ETL)' with command: ['C:\Users\\venvs\etl-env\noscripts\python.exe', '-Xfrozen_modules=off', '-m', 'ipykernel_launcher', '-f', 'C:\Users\\AppData\Roaming\jupyter\runtime\kernel-c66b786d-403c-493f-84f4-458b61a41541.json']
[D 2024-11-17 18:54:53.267 EnterpriseGatewayApp] BaseProcessProxy.launch_process() env: {'KERNEL_LAUNCH_TIMEOUT': '', 'KERNEL_WORKING_DIR': '', 'KERNEL_USERNAME': '', 'KERNEL_GATEWAY': '', 'KERNEL_ID': '', 'KERNEL_LANGUAGE': '', 'EG_IMPERSONATION_ENABLED': ''}
[I 2024-11-17 18:54:53.273 EnterpriseGatewayApp] Local kernel launched on 'ip', pid: 16132, pgid: 0, KernelID: c66b786d-403c-493f-84f4-458b61a41541, cmd: '['C:\Users\\venvs\etl-env\noscripts\python.exe', '-Xfrozen_modules=off', '-m', 'ipykernel_launcher', '-f', 'C:\Users\\AppData\Roaming\jupyter\runtime\kernel-c66b786d-403c-493f-84f4-458b61a41541.json']'
[D 2024-11-17 18:54:53.274 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61198
[D 2024-11-17 18:54:53.281 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61195
[I 2024-11-17 18:54:53.284 EnterpriseGatewayApp] Kernel started: c66b786d-403c-493f-84f4-458b61a41541
[D 2024-11-17 18:54:53.284 EnterpriseGatewayApp] Kernel args: {'env': {'KERNEL_LAUNCH_TIMEOUT': '40', 'KERNEL_WORKING_DIR': 'a path on my laptop', 'KERNEL_USERNAME': 'Laptop username'}, 'kernel_headers': {}, 'kernel_name': 'etl-env'}
[I 241117 18:54:53 web:2348] 201 POST /api/kernels (ip) 29.00ms
[D 2024-11-17 18:54:53.344 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[D 2024-11-17 18:54:53.344 EnterpriseGatewayApp] Requesting kernel info from c66b786d-403c-493f-84f4-458b61a41541
[D 2024-11-17 18:54:53.346 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61194
[I 241117 18:54:53 web:2348] 200 GET /api/kernels (ip) 0.00ms
[D 2024-11-17 18:54:53.367 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[D 2024-11-17 18:54:53.368 EnterpriseGatewayApp] Waiting for pending kernel_info request
[D 2024-11-17 18:54:53.378 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[W 2024-11-17 18:54:53.379 EnterpriseGatewayApp] Replacing stale connection: c66b786d-403c-493f-84f4-458b61a41541:66351527-a8ee-422a-9305-f3b432ee58df
[D
/r/IPython
https://redd.it/1gtkajw
Hi,
I try to run JEG on my windows server 2019 to connect my laptop to the kernels on the server.
Connection works fine, kernels are starting but closing after WebSocket timeout.
Here is what I can see in the JEG console
D 2024-11-17 18:54:53.267 EnterpriseGatewayApp] Launching kernel: 'Python 3 (ETL)' with command: ['C:\Users\\venvs\etl-env\noscripts\python.exe', '-Xfrozen_modules=off', '-m', 'ipykernel_launcher', '-f', 'C:\Users\\AppData\Roaming\jupyter\runtime\kernel-c66b786d-403c-493f-84f4-458b61a41541.json']
[D 2024-11-17 18:54:53.267 EnterpriseGatewayApp] BaseProcessProxy.launch_process() env: {'KERNEL_LAUNCH_TIMEOUT': '', 'KERNEL_WORKING_DIR': '', 'KERNEL_USERNAME': '', 'KERNEL_GATEWAY': '', 'KERNEL_ID': '', 'KERNEL_LANGUAGE': '', 'EG_IMPERSONATION_ENABLED': ''}
[I 2024-11-17 18:54:53.273 EnterpriseGatewayApp] Local kernel launched on 'ip', pid: 16132, pgid: 0, KernelID: c66b786d-403c-493f-84f4-458b61a41541, cmd: '['C:\Users\\venvs\etl-env\noscripts\python.exe', '-Xfrozen_modules=off', '-m', 'ipykernel_launcher', '-f', 'C:\Users\\AppData\Roaming\jupyter\runtime\kernel-c66b786d-403c-493f-84f4-458b61a41541.json']'
[D 2024-11-17 18:54:53.274 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61198
[D 2024-11-17 18:54:53.281 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61195
[I 2024-11-17 18:54:53.284 EnterpriseGatewayApp] Kernel started: c66b786d-403c-493f-84f4-458b61a41541
[D 2024-11-17 18:54:53.284 EnterpriseGatewayApp] Kernel args: {'env': {'KERNEL_LAUNCH_TIMEOUT': '40', 'KERNEL_WORKING_DIR': 'a path on my laptop', 'KERNEL_USERNAME': 'Laptop username'}, 'kernel_headers': {}, 'kernel_name': 'etl-env'}
[I 241117 18:54:53 web:2348] 201 POST /api/kernels (ip) 29.00ms
[D 2024-11-17 18:54:53.344 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[D 2024-11-17 18:54:53.344 EnterpriseGatewayApp] Requesting kernel info from c66b786d-403c-493f-84f4-458b61a41541
[D 2024-11-17 18:54:53.346 EnterpriseGatewayApp] Connecting to: tcp://127.0.0.1:61194
[I 241117 18:54:53 web:2348] 200 GET /api/kernels (ip) 0.00ms
[D 2024-11-17 18:54:53.367 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[D 2024-11-17 18:54:53.368 EnterpriseGatewayApp] Waiting for pending kernel_info request
[D 2024-11-17 18:54:53.378 EnterpriseGatewayApp] Initializing websocket connection /api/kernels/c66b786d-403c-493f-84f4-458b61a41541/channels
[W 2024-11-17 18:54:53.379 EnterpriseGatewayApp] Replacing stale connection: c66b786d-403c-493f-84f4-458b61a41541:66351527-a8ee-422a-9305-f3b432ee58df
[D
/r/IPython
https://redd.it/1gtkajw
Reddit
From the IPython community on Reddit
Explore this post and more from the IPython community
Monday Daily Thread: Project ideas!
# Weekly Thread: Project Ideas 💡
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
## How it Works:
1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.
## Guidelines:
* Clearly state the difficulty level.
* Provide a brief denoscription and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.
# Example Submissions:
## Project Idea: Chatbot
**Difficulty**: Intermediate
**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar
**Denoscription**: Create a chatbot that can answer FAQs for a website.
**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)
# Project Idea: Weather Dashboard
**Difficulty**: Beginner
**Tech Stack**: HTML, CSS, JavaScript, API
**Denoscription**: Build a dashboard that displays real-time weather information using a weather API.
**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)
## Project Idea: File Organizer
**Difficulty**: Beginner
**Tech Stack**: Python, File I/O
**Denoscription**: Create a noscript that organizes files in a directory into sub-folders based on file type.
**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)
Let's help each other grow. Happy
/r/Python
https://redd.it/1gtrhgb
# Weekly Thread: Project Ideas 💡
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
## How it Works:
1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.
## Guidelines:
* Clearly state the difficulty level.
* Provide a brief denoscription and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.
# Example Submissions:
## Project Idea: Chatbot
**Difficulty**: Intermediate
**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar
**Denoscription**: Create a chatbot that can answer FAQs for a website.
**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)
# Project Idea: Weather Dashboard
**Difficulty**: Beginner
**Tech Stack**: HTML, CSS, JavaScript, API
**Denoscription**: Build a dashboard that displays real-time weather information using a weather API.
**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)
## Project Idea: File Organizer
**Difficulty**: Beginner
**Tech Stack**: Python, File I/O
**Denoscription**: Create a noscript that organizes files in a directory into sub-folders based on file type.
**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)
Let's help each other grow. Happy
/r/Python
https://redd.it/1gtrhgb
YouTube
Build & Integrate your own custom chatbot to a website (Python & JavaScript)
In this fun project you learn how to build a custom chatbot in Python and then integrate this to a website using Flask and JavaScript.
Starter Files: https://github.com/patrickloeber/chatbot-deployment
Get my Free NumPy Handbook: https://www.python-engi…
Starter Files: https://github.com/patrickloeber/chatbot-deployment
Get my Free NumPy Handbook: https://www.python-engi…
ididi, now with version 1.0.4, supports infinite number of nested scopes!
Hello my peer pythonistas!
9 days ago, I posted my dependency injection lib here
https://www.reddit.com/r/Python/comments/1gn5erp/ididi\_dependency\_injection\_in\_a\_single\_line\_of
In 9 days, ididi has iterated 13 versions, and reached the milestone of 1.0.0(1.0.4 now actually).
https://github.com/raceychan/ididi
I am bringing back ididi to you with a powerful new feature and a nice new documentation.
https://raceychan.github.io/ididi/features/#using-scope-to-manage-resources
A scope is a context that manage the lifespan of resources, a classic usecase would be creating a different database session/connection for each request user send to your endpoint, this separate data access among users.
Unlike most alternatives that either does not support scope, or support finite number of pre-defined scopes,
Ididi now supports infinite number of nested scopes
let's take a glance at the usage here.
async with dg.scope(appname) as appscope:
async with dg.scope(router) as routerscope:
async with dg.scope(endpoint) as endpointscope:
async with dg.scope(userid) as userscope:
async with dg.scope(requestid) as requestscope:
for a basic usage
/r/Python
https://redd.it/1gtr77s
Hello my peer pythonistas!
9 days ago, I posted my dependency injection lib here
https://www.reddit.com/r/Python/comments/1gn5erp/ididi\_dependency\_injection\_in\_a\_single\_line\_of
In 9 days, ididi has iterated 13 versions, and reached the milestone of 1.0.0(1.0.4 now actually).
https://github.com/raceychan/ididi
I am bringing back ididi to you with a powerful new feature and a nice new documentation.
https://raceychan.github.io/ididi/features/#using-scope-to-manage-resources
A scope is a context that manage the lifespan of resources, a classic usecase would be creating a different database session/connection for each request user send to your endpoint, this separate data access among users.
Unlike most alternatives that either does not support scope, or support finite number of pre-defined scopes,
Ididi now supports infinite number of nested scopes
let's take a glance at the usage here.
async with dg.scope(appname) as appscope:
async with dg.scope(router) as routerscope:
async with dg.scope(endpoint) as endpointscope:
async with dg.scope(userid) as userscope:
async with dg.scope(requestid) as requestscope:
for a basic usage
/r/Python
https://redd.it/1gtr77s
Reddit
From the Python community on Reddit: Ididi, dependency injection, in a single line of code
Explore this post and more from the Python community
ansiplot: Pretty (and legible) small console plots.
What My Project Does
Hi all! While developing something different I realized that it would be nice to have a way of plotting multiple curves in the console to get comparative insights (which of those curves is better or worse at certain regions). I am thinking of a 40x10 to 60x20 canvas and maybe 10+ curves that will probably be overlapping a lot.
I couldn't find something to match the exact use case, so I made yet another console plotter:
https://github.com/maniospas/ansiplot
Target Audience
This is mostly a toy project in the sense that it covers the functionalities I am interested in and was made pretty quickly (in an evening). That said, I am creating it for my own production and will be polishing it as needed, so all feedback is welcome.
Comparison
My previous options were previously [asciichart\](https://github.com/kroitor/asciichart), [drawilleplot\](https://github.com/gooofy/drawilleplot) and [asciiplot\](https://github.com/w2sv/asciiplot). I think ansiplot looks less "clean" because it is restricted to using one symbol per curve, creates thicker lines, and does not show axis tics other than the values for mins and maxs (of course, one can add bars to mark precise points).
The first two shortcomings are conscious design decision in service of two features I consider very important:
\- The plots look pretty with
/r/Python
https://redd.it/1gtvy3o
What My Project Does
Hi all! While developing something different I realized that it would be nice to have a way of plotting multiple curves in the console to get comparative insights (which of those curves is better or worse at certain regions). I am thinking of a 40x10 to 60x20 canvas and maybe 10+ curves that will probably be overlapping a lot.
I couldn't find something to match the exact use case, so I made yet another console plotter:
https://github.com/maniospas/ansiplot
Target Audience
This is mostly a toy project in the sense that it covers the functionalities I am interested in and was made pretty quickly (in an evening). That said, I am creating it for my own production and will be polishing it as needed, so all feedback is welcome.
Comparison
My previous options were previously [asciichart\](https://github.com/kroitor/asciichart), [drawilleplot\](https://github.com/gooofy/drawilleplot) and [asciiplot\](https://github.com/w2sv/asciiplot). I think ansiplot looks less "clean" because it is restricted to using one symbol per curve, creates thicker lines, and does not show axis tics other than the values for mins and maxs (of course, one can add bars to mark precise points).
The first two shortcomings are conscious design decision in service of two features I consider very important:
\- The plots look pretty with
/r/Python
https://redd.it/1gtvy3o
GitHub
GitHub - maniospas/ansiplot: Pretty (and legible) console plots in Python.
Pretty (and legible) console plots in Python. Contribute to maniospas/ansiplot development by creating an account on GitHub.
I Understand Machine Learning Models Better by Combining Python Libraries
Hi folks,
I’m currently super interested in neural networks, and I bet many of you are too. PyTorch is the hottest Python library for Machine Learning right now. For anyone starting out, PyTorch can be hard to understand. That’s why I combined PyTorch with Manim (3b1b) to:
1. Train a neural network (PyTorch), and
2. Visualize the model architecture (Manim).
I think the combination of these two Python libraries makes it relatively easy to get started with ML. https://youtu.be/zLEt5oz5Mr8?si=cY-Riirhdi66Zqfy
Have you worked with PyTorch and Manim before? I find Manim particularly challenging, as it often feels like a work in progress.
/r/Python
https://redd.it/1gtyh9o
Hi folks,
I’m currently super interested in neural networks, and I bet many of you are too. PyTorch is the hottest Python library for Machine Learning right now. For anyone starting out, PyTorch can be hard to understand. That’s why I combined PyTorch with Manim (3b1b) to:
1. Train a neural network (PyTorch), and
2. Visualize the model architecture (Manim).
I think the combination of these two Python libraries makes it relatively easy to get started with ML. https://youtu.be/zLEt5oz5Mr8?si=cY-Riirhdi66Zqfy
Have you worked with PyTorch and Manim before? I find Manim particularly challenging, as it often feels like a work in progress.
/r/Python
https://redd.it/1gtyh9o
YouTube
Visual Explanation of Convolutional Neural Network for Image Classification – PyTorch Tutorial
In this video, we’ll classify fruit images using a CNN built in PyTorch while exploring every layer of the model visually.
🔗 Link Python Script: https://drive.google.com/file/d/19yxZ_p4JWyoI62y3JVmxj2F1XfAha9Os/view?usp=sharing
Let me know your thoughts…
🔗 Link Python Script: https://drive.google.com/file/d/19yxZ_p4JWyoI62y3JVmxj2F1XfAha9Os/view?usp=sharing
Let me know your thoughts…
Safe to delete all migration files, run makemigrations and apply the new migration?
Have a repo with 3+ years of migrations and wanted to clean them up. Have read a bit on the squashmigrations-noscript but shouldn't I just be able to delete all the migration files, create a new migration containing all the changes and then run migrate, applying that one?
We don't have any custom migrations that need to be ran.
/r/django
https://redd.it/1gtzh7o
Have a repo with 3+ years of migrations and wanted to clean them up. Have read a bit on the squashmigrations-noscript but shouldn't I just be able to delete all the migration files, create a new migration containing all the changes and then run migrate, applying that one?
We don't have any custom migrations that need to be ran.
/r/django
https://redd.it/1gtzh7o
Reddit
From the django community on Reddit
Explore this post and more from the django community
What AI APIs and toolkits do you use these days to develop a SaaS or any AI-empowered webapp ?
Hey everyone, building AI-empowered consumer products and SaaS is trending these days. I'm curious—besides the obvious ones like ChatGPT or Claude—what tools and APIs do you use to develop faster and more sophisticated web apps?
/r/django
https://redd.it/1gtzu7b
Hey everyone, building AI-empowered consumer products and SaaS is trending these days. I'm curious—besides the obvious ones like ChatGPT or Claude—what tools and APIs do you use to develop faster and more sophisticated web apps?
/r/django
https://redd.it/1gtzu7b
Reddit
From the django community on Reddit
Explore this post and more from the django community
Recursion stuff
So I have a model Task. Each Task can have a subtask and each subtask can have further subtasks. When I display my DetailView, I want to render a Task with a list of its subtasks that are each linked to their own DetailView page. The above all works fine. The problem is when I go to the subtasks detail page, I don't see a list of its subtasks. For example, if I have Big Task (Task), Little Task (Subtask), and Puny Task (Subtask of subtask), when I go to Big Tasks' detail view I see Little Task but when I go to Little Task's detail view I don't see Puny Task (but I do see other information like noscript and denoscription).
The Task model looks like:
class Task(models.Model):
noscript = models.CharField(max_length=255)
denoscription = models.TextField(blank=True, null=True)
completed = models.BooleanField(default=False)
due_date = models.DateTimeField(blank=True, null=True)
parent_task = models.ForeignKey(
/r/django
https://redd.it/1gtrcy0
So I have a model Task. Each Task can have a subtask and each subtask can have further subtasks. When I display my DetailView, I want to render a Task with a list of its subtasks that are each linked to their own DetailView page. The above all works fine. The problem is when I go to the subtasks detail page, I don't see a list of its subtasks. For example, if I have Big Task (Task), Little Task (Subtask), and Puny Task (Subtask of subtask), when I go to Big Tasks' detail view I see Little Task but when I go to Little Task's detail view I don't see Puny Task (but I do see other information like noscript and denoscription).
The Task model looks like:
class Task(models.Model):
noscript = models.CharField(max_length=255)
denoscription = models.TextField(blank=True, null=True)
completed = models.BooleanField(default=False)
due_date = models.DateTimeField(blank=True, null=True)
parent_task = models.ForeignKey(
/r/django
https://redd.it/1gtrcy0
Reddit
From the django community on Reddit
Explore this post and more from the django community
Python Crash Course Notebook for Data Engineering
Hey everyone! Over the last 2 weeks, I put together a **crash course on Python** specifically tailored for Data Engineers. I hope you find it useful! I have been a data engineer for 4+ years and went through various blogs, courses to make sure I cover the essentials along with my own experience.
Feedback and suggestions are always welcome!
📔 **Full Noteboo**k: [Google Colab](https://colab.research.google.com/drive/1r_MmG8vxxboXQCCoXbk2nxEG9mwCjnNy?usp=sharing)
🎥 **Walkthrough Vide**o (1 hour): [YouTube](https://youtu.be/IJm--UbuSaM)
💡 Topics Covered:
1. Python Basics
* Syntax, variables, loops, and conditionals.
2. Working with Collections
* Lists, dictionaries, tuples, and sets.
3. File Handling
* Reading/writing CSV, JSON, Excel, and Parquet files.
4. Data Processing
* Cleaning, aggregating, and analyzing data with pandas and NumPy.
5. Numerical Computing
* Advanced operations with NumPy for efficient computation.
6. Date and Time Manipulations
* Parsing, formatting, and managing date time data.
7. APIs and External Data Connections
* Fetching data securely and integrating APIs into pipelines.
8. Object-Oriented Programming (OOP)
* Designing modular and reusable code.
9. Building ETL Pipelines
* End-to-end workflows for extracting, transforming, and loading data.
10. Data Quality and Testing
* Using `unittest`, `great_expectations`, and `flake8` to ensure clean and robust code.
1. Creating and Deploying Python Packages
* Structuring, building, and distributing Python
/r/Python
https://redd.it/1gu3her
Hey everyone! Over the last 2 weeks, I put together a **crash course on Python** specifically tailored for Data Engineers. I hope you find it useful! I have been a data engineer for 4+ years and went through various blogs, courses to make sure I cover the essentials along with my own experience.
Feedback and suggestions are always welcome!
📔 **Full Noteboo**k: [Google Colab](https://colab.research.google.com/drive/1r_MmG8vxxboXQCCoXbk2nxEG9mwCjnNy?usp=sharing)
🎥 **Walkthrough Vide**o (1 hour): [YouTube](https://youtu.be/IJm--UbuSaM)
💡 Topics Covered:
1. Python Basics
* Syntax, variables, loops, and conditionals.
2. Working with Collections
* Lists, dictionaries, tuples, and sets.
3. File Handling
* Reading/writing CSV, JSON, Excel, and Parquet files.
4. Data Processing
* Cleaning, aggregating, and analyzing data with pandas and NumPy.
5. Numerical Computing
* Advanced operations with NumPy for efficient computation.
6. Date and Time Manipulations
* Parsing, formatting, and managing date time data.
7. APIs and External Data Connections
* Fetching data securely and integrating APIs into pipelines.
8. Object-Oriented Programming (OOP)
* Designing modular and reusable code.
9. Building ETL Pipelines
* End-to-end workflows for extracting, transforming, and loading data.
10. Data Quality and Testing
* Using `unittest`, `great_expectations`, and `flake8` to ensure clean and robust code.
1. Creating and Deploying Python Packages
* Structuring, building, and distributing Python
/r/Python
https://redd.it/1gu3her
Google
Python for Data Engineers - Analytics Vector.ipynb
Colab notebook
For those of you that purchase templates online, is there a better way to edit the files to run it in flask?
I purchased a Bootstrap template online today and started to hack away at it to make it work with a website I am building with Flask. This involves rearranging files, folders and more annoyingly, going through all the links in the HTML that refer to images, css, js, and other HTML pages in the project and editing them with the
Is there a better way to do this or is this just one of those annoying initial setup things that I need to do manually?
/r/flask
https://redd.it/1gtv56b
I purchased a Bootstrap template online today and started to hack away at it to make it work with a website I am building with Flask. This involves rearranging files, folders and more annoyingly, going through all the links in the HTML that refer to images, css, js, and other HTML pages in the project and editing them with the
{{ url_for('static', filename='...'}} code Jinja expects. Is there a better way to do this or is this just one of those annoying initial setup things that I need to do manually?
/r/flask
https://redd.it/1gtv56b
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Support Python: Our End-of-Year Fundraiser with PyCharm Discount is live
Our end of year fundraiser and membership drive has launched! There are 3 ways to join in to support Python and the PSF:
- 30% off @PyCharm
from JetBrains
- Donate directly
- Become a member
Learn more
Python empowers you to build amazing tools, build/grow companies, and secure jobs—all for free! Consider giving back today.
/r/Python
https://redd.it/1gu7g70
Our end of year fundraiser and membership drive has launched! There are 3 ways to join in to support Python and the PSF:
- 30% off @PyCharm
from JetBrains
- Donate directly
- Become a member
Learn more
Python empowers you to build amazing tools, build/grow companies, and secure jobs—all for free! Consider giving back today.
/r/Python
https://redd.it/1gu7g70
JetBrains: Developer Tools for Professionals and Teams
Support Python With JetBrains
Purchase PyCharm at 30% OFF, and have all the proceeds of your purchase donated to support Python.
difficulty with flask-login
I'm a beginner in Flask, and I think I didn't find this information in the documentation, or I may not have understood/read it correctly.
But, I'm having the following problem:
I can log my user into my application, everything works perfectly, but if I type the /login page again, it is accessed, even though the user is already authenticated. Is there a way that when the user is already logged in, the login page is not accessed and redirects to the home page, for example?
I would be very grateful to anyone who can help.
/r/flask
https://redd.it/1gtqpy0
I'm a beginner in Flask, and I think I didn't find this information in the documentation, or I may not have understood/read it correctly.
But, I'm having the following problem:
I can log my user into my application, everything works perfectly, but if I type the /login page again, it is accessed, even though the user is already authenticated. Is there a way that when the user is already logged in, the login page is not accessed and redirects to the home page, for example?
I would be very grateful to anyone who can help.
/r/flask
https://redd.it/1gtqpy0
Reddit
From the flask community on Reddit
Explore this post and more from the flask community