Is using
Hey everyone,
To get my linter and IDE (free PyCharm) to recognize the type of the default
This works and solves the "unresolved attribute" warnings.
Is this a good, standard practice, or is it considered a hack? I know PyCharm Pro handles this, but as a poor/greedy programmer, I'm looking for a free solution. 😅
Thanks!
/r/django
https://redd.it/1l9lfpy
if TYPE_CHECKING: to type the objects manager a good practice?Hey everyone,
To get my linter and IDE (free PyCharm) to recognize the type of the default
objects manager, I'm using this pattern:# models.py
from typing import TYPE_CHECKING
from django.db import models
if TYPE_CHECKING:
from django.db.models.manager import Manager
class MyModel(models.Model):
# ... fields ...
# is this ok?
if TYPE_CHECKING:
objects: Manager["MyModel"]
This works and solves the "unresolved attribute" warnings.
Is this a good, standard practice, or is it considered a hack? I know PyCharm Pro handles this, but as a poor/greedy programmer, I'm looking for a free solution. 😅
Thanks!
/r/django
https://redd.it/1l9lfpy
Reddit
From the django community on Reddit
Explore this post and more from the django community
Django 101 - High-Level Overview of Django Project Components
https://www.youtube.com/watch?v=deMO0wIwJis
/r/django
https://redd.it/1l9l2p2
https://www.youtube.com/watch?v=deMO0wIwJis
/r/django
https://redd.it/1l9l2p2
YouTube
Django 101 - High-Level overview of Django project components
🙏 Join our channel to get access to perks:
https://www.youtube.com/channel/UCTwxaBjziKfy6y_uWu30orA/join
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying a coffee here:
https://ko-fi.com/bugbytes
In this video…
https://www.youtube.com/channel/UCTwxaBjziKfy6y_uWu30orA/join
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying a coffee here:
https://ko-fi.com/bugbytes
In this video…
Django statics won't work for admin & drf
Workign on updating my django 4.x to 5.x. I noticed that statics for django admin & drf weren't working.
Solution: Disabled (comment out) django debug toolbar from installed apps and middleware section in settings.py. FYI, I have a local docker compose serving minio s3.
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
os.path.join(BASE_DIR, "media"),
]
# Static files
STATIC_URL = f"{STATIC_URL_BUCKET}/static/" # Or use your public MinIO endpoint
# Media files (user uploads)
MEDIA_URL = "/media/" # Not used for direct serving, but required by Django
/r/django
https://redd.it/1l9xedh
Workign on updating my django 4.x to 5.x. I noticed that statics for django admin & drf weren't working.
Solution: Disabled (comment out) django debug toolbar from installed apps and middleware section in settings.py. FYI, I have a local docker compose serving minio s3.
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
os.path.join(BASE_DIR, "media"),
]
# Static files
STATIC_URL = f"{STATIC_URL_BUCKET}/static/" # Or use your public MinIO endpoint
# Media files (user uploads)
MEDIA_URL = "/media/" # Not used for direct serving, but required by Django
/r/django
https://redd.it/1l9xedh
Reddit
From the django community on Reddit
Explore this post and more from the django community
Website version of Christopher Manson's 1985 puzzle book, "Maze"
This out of print book was from before my time, but Maze: Solve the World's Most Challenging Puzzle by Christopher Manson was a sort of choose-your-own-adventure book that had a $10,000 prize for whoever solved it first. (No one did; the prize was eventually split up among twelve people who got the closest.)
I created a modern, mobile-friendly web version of the book.
GitHub (with Python source): https://github.com/asweigart/mazewebsite
Website: https://inventwithpython.com/mazewebsite/
Start of the maze: https://inventwithpython.com/mazewebsite/directions.html
There are 45 "rooms" in the maze. I created HTML image maps and gathered the text descriptions into a throwaway Python script that generates the html files for the maze. I didn't want it to rely on a database or backend, just HTML, CSS, and a little Bootstrap to make it mobile-friendly. The Python code is in the git repo.
## What My Project Does
Generates HTML files for a web version of Christopher Manson's 1985 puzzle book, "Maze"
## Target Audience
Anyone can view the output website. The Python code may be of interest to people who have similar one-off projects.
## Comparison
The throwaway script spits out html files, making it easy for me to make updates to all 45 pages at once. It's a one-off project that doesn't use other modules, so it's
/r/Python
https://redd.it/1l9urle
This out of print book was from before my time, but Maze: Solve the World's Most Challenging Puzzle by Christopher Manson was a sort of choose-your-own-adventure book that had a $10,000 prize for whoever solved it first. (No one did; the prize was eventually split up among twelve people who got the closest.)
I created a modern, mobile-friendly web version of the book.
GitHub (with Python source): https://github.com/asweigart/mazewebsite
Website: https://inventwithpython.com/mazewebsite/
Start of the maze: https://inventwithpython.com/mazewebsite/directions.html
There are 45 "rooms" in the maze. I created HTML image maps and gathered the text descriptions into a throwaway Python script that generates the html files for the maze. I didn't want it to rely on a database or backend, just HTML, CSS, and a little Bootstrap to make it mobile-friendly. The Python code is in the git repo.
## What My Project Does
Generates HTML files for a web version of Christopher Manson's 1985 puzzle book, "Maze"
## Target Audience
Anyone can view the output website. The Python code may be of interest to people who have similar one-off projects.
## Comparison
The throwaway script spits out html files, making it easy for me to make updates to all 45 pages at once. It's a one-off project that doesn't use other modules, so it's
/r/Python
https://redd.it/1l9urle
GitHub
GitHub - asweigart/mazewebsite: Website version of Christopher Manson's 1985 book, Maze: Solve the World's Most Challenging Puzzle
Website version of Christopher Manson's 1985 book, Maze: Solve the World's Most Challenging Puzzle - asweigart/mazewebsite
Productivity Tracker CLI
Hi there!
I've completed a project recently that I would like to share. It is a productivity tracker that allows you to record how much time you spend working on something. Here is a link to it https://github.com/tossik8/tracker.
I made this project because I wanted to improve my time management. Feel free to leave your feedback and I hope some of you find it useful as well!
/r/Python
https://redd.it/1l9re6v
Hi there!
I've completed a project recently that I would like to share. It is a productivity tracker that allows you to record how much time you spend working on something. Here is a link to it https://github.com/tossik8/tracker.
I made this project because I wanted to improve my time management. Feel free to leave your feedback and I hope some of you find it useful as well!
/r/Python
https://redd.it/1l9re6v
GitHub
GitHub - tossik8/tracker
Contribute to tossik8/tracker development by creating an account on GitHub.
Friday Daily Thread: r/Python Meta and Free-Talk Fridays
# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️
Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!
## How it Works:
1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.
## Guidelines:
All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.
## Example Topics:
1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.
Let's keep the conversation going. Happy discussing! 🌟
/r/Python
https://redd.it/1la1w5g
# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️
Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!
## How it Works:
1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.
## Guidelines:
All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.
## Example Topics:
1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.
Let's keep the conversation going. Happy discussing! 🌟
/r/Python
https://redd.it/1la1w5g
Redditinc
Reddit Rules
Reddit Rules - Reddit
Blog: ReThinking Django Template: Part 2
Tired of SVG mess in your Django templates?
My latest post, "ReThinking Django Template: Part 2," dives deep into efficient ways to handle inline SVG icons. From handy packages like
Ready to make your Django templates much cleaner?
ReThinking Django Template: Part 2
/r/django
https://redd.it/1l9iywe
Tired of SVG mess in your Django templates?
My latest post, "ReThinking Django Template: Part 2," dives deep into efficient ways to handle inline SVG icons. From handy packages like
heroicons and dj-svg to building your own powerful components, I've got solutions to clean up your Django template code and boost reusability. Ready to make your Django templates much cleaner?
ReThinking Django Template: Part 2
/r/django
https://redd.it/1l9iywe
Saashammer
ReThinking Django Template: Part 2
Learn efficient ways to manage SVG icons in Django templates. Explore using Django packages like heroicons and dj-svg, or create custom components for better maintainability and reusability.
JupyterLite 0.6.0 is released! 🎉
https://blog.jupyter.org/jupyterlite-0-6-0-is-released-b4bc69bfc8f4
/r/IPython
https://redd.it/1l9oup2
https://blog.jupyter.org/jupyterlite-0-6-0-is-released-b4bc69bfc8f4
/r/IPython
https://redd.it/1l9oup2
Medium
JupyterLite 0.6.0 is released! 🎉
JupyterLite 0.6.0 includes a number of new features, bug fixes, and enhancements and significant improvements to the user interface.
I can't seem to get the flask app with blueprints. Does anyone know how to fix this?
I have a flask app structured similar to this https://github.com/miguelgrinberg/microblog.
Also instead of microblog.py I just called the file run.py
Here is my file-path in the app in powershell.
(my_env) PS C:\\Users\\user\\Downloads\\myapp
The first picture is myapp folder and files within them.
https://imgur.com/a/OUOtQ5N
The second picture is app folder and files within them though I removed some names because I am working on an original idea
https://imgur.com/a/ZBXGnQr
Also am I correct folder and Should I setup my flask app like https://github.com/miguelgrinberg/microblog ?
Here is myapp/config.py.
https://paste.pythondiscord.com/PEHA
Here is my init.py folder in the app folder.
https://paste.pythondiscord.com/YKAQ
Here is models.py
https://paste.pythondiscord.com/IVRA
myapp/run.py
```py
from app import create_app
app = create_app()
```
Here is what I am using to run the flask app
```
$env:FLASK_DEBUG=1
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_ENV='dev'
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_DEBUG=1
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_APP = "run.py"
(some_env) PS C:\\Users\\user\\Downloads\\myapp> flask run
```
Here is the error and output after I run `flask run`
```py
Usage: flask run [OPTIONS\]
Try 'flask run --help' for help.
Error: While importing 'myapp.app', an ImportError was raised:
Traceback (most recent call last):
File "C:\\Users\\user\\Downloads\\myapp\\my_env\\Lib\\site-packages\\flask\\cli.py", line 245, in locate_app
__import__(module_name)
\~\~\~\~\~\~\~\~\~\~\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\user\\Downloads\\myapp\\app\\__init__.py", line 17, in <module>
from .models import User
File "C:\\Users\\user\\Downloads\\myapp\\app\\models.py", line 10, in <module>
from ..app import db
ImportError: cannot import name 'db' from partially initialized module 'mylapp.app' (most likely due to
/r/flask
https://redd.it/1la2vuo
I have a flask app structured similar to this https://github.com/miguelgrinberg/microblog.
Also instead of microblog.py I just called the file run.py
Here is my file-path in the app in powershell.
(my_env) PS C:\\Users\\user\\Downloads\\myapp
The first picture is myapp folder and files within them.
https://imgur.com/a/OUOtQ5N
The second picture is app folder and files within them though I removed some names because I am working on an original idea
https://imgur.com/a/ZBXGnQr
Also am I correct folder and Should I setup my flask app like https://github.com/miguelgrinberg/microblog ?
Here is myapp/config.py.
https://paste.pythondiscord.com/PEHA
Here is my init.py folder in the app folder.
https://paste.pythondiscord.com/YKAQ
Here is models.py
https://paste.pythondiscord.com/IVRA
myapp/run.py
```py
from app import create_app
app = create_app()
```
Here is what I am using to run the flask app
```
$env:FLASK_DEBUG=1
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_ENV='dev'
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_DEBUG=1
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_APP = "run.py"
(some_env) PS C:\\Users\\user\\Downloads\\myapp> flask run
```
Here is the error and output after I run `flask run`
```py
Usage: flask run [OPTIONS\]
Try 'flask run --help' for help.
Error: While importing 'myapp.app', an ImportError was raised:
Traceback (most recent call last):
File "C:\\Users\\user\\Downloads\\myapp\\my_env\\Lib\\site-packages\\flask\\cli.py", line 245, in locate_app
__import__(module_name)
\~\~\~\~\~\~\~\~\~\~\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\user\\Downloads\\myapp\\app\\__init__.py", line 17, in <module>
from .models import User
File "C:\\Users\\user\\Downloads\\myapp\\app\\models.py", line 10, in <module>
from ..app import db
ImportError: cannot import name 'db' from partially initialized module 'mylapp.app' (most likely due to
/r/flask
https://redd.it/1la2vuo
GitHub
GitHub - miguelgrinberg/microblog: The microblogging application developed in my Flask Mega-Tutorial series. This version maps…
The microblogging application developed in my Flask Mega-Tutorial series. This version maps to the 2024 Edition of the tutorial. - miguelgrinberg/microblog
SQLAlchemy just the core - but improved - for no-ORM folks
Project: https://github.com/sayanarijit/sqla-fancy-core
What my project does:
There are plenty of ORMs to choose from in Python world, but not many sql query makers for folks who prefer to stay close to the original SQL syntax, without sacrificing security and code readability. The closest, most mature and most flexible query maker you can find is SQLAlchemy core.
But the syntax of defining tables and making queries has a lot of scope for improvement. For example, the table.c.column syntax is too dynamic, unreadable, and probably has performance impact too. It also doesn’t play along with static type checkers and linting tools.
So here I present one attempt at getting the best out of SQLAlchemy core by changing the way we define tables.
The table factory class it exposes, helps define tables in a way that eliminates the above drawbacks. Moreover, you can subclass it to add your preferred global defaults for columns (e.g. not null as default). Or specify custom column types with consistent naming (e.g. created_at).
Target audience:
Production. For folks who prefer query maker over ORM.
Comparison with other projects:
Piccolo: Tight integration with drivers. Very opinionated. Not as flexible or mature as sqlalchemy core.
Pypika: Doesn’t prevent sql injection by default. Hence can be considered insecure.
Raw queries as strings
/r/Python
https://redd.it/1la4yvk
Project: https://github.com/sayanarijit/sqla-fancy-core
What my project does:
There are plenty of ORMs to choose from in Python world, but not many sql query makers for folks who prefer to stay close to the original SQL syntax, without sacrificing security and code readability. The closest, most mature and most flexible query maker you can find is SQLAlchemy core.
But the syntax of defining tables and making queries has a lot of scope for improvement. For example, the table.c.column syntax is too dynamic, unreadable, and probably has performance impact too. It also doesn’t play along with static type checkers and linting tools.
So here I present one attempt at getting the best out of SQLAlchemy core by changing the way we define tables.
The table factory class it exposes, helps define tables in a way that eliminates the above drawbacks. Moreover, you can subclass it to add your preferred global defaults for columns (e.g. not null as default). Or specify custom column types with consistent naming (e.g. created_at).
Target audience:
Production. For folks who prefer query maker over ORM.
Comparison with other projects:
Piccolo: Tight integration with drivers. Very opinionated. Not as flexible or mature as sqlalchemy core.
Pypika: Doesn’t prevent sql injection by default. Hence can be considered insecure.
Raw queries as strings
/r/Python
https://redd.it/1la4yvk
GitHub
GitHub - sayanarijit/sqla-fancy-core: A collection of type-safe, async friendly, and un-opinionated enhancements to SQLAlchemy…
A collection of type-safe, async friendly, and un-opinionated enhancements to SQLAlchemy Core that works well with mordern web servers - sayanarijit/sqla-fancy-core
Pypp: A Python to C++ transpiler WIP. Gauging interest and open to advice.
I am trying to gauge interest in this project, and I am also open to any advice people want to give. Here is the project github: https://github.com/curtispuetz/pypp
# Pypp (a Python to C++ transpiler)
This project is a work-in-progress. Below you will find sections: The goal, The idea (What My Project Does), How is this possible?, The inspiration (Target Audience), Why not cython, pypy, or Nuitka? (Comparison), and What works today?
## The goal
The primary goal of this project is to make the end-product of your Python projects execute faster.
## What My Project Does
The idea is to transpile your Python project into a C++ cmake project, which can be built and executed much faster, as C/C++ is the fastest high-level language of today.
You will be able to run your code either with the Python interpreter, or by transpiling it to C++ and then building it with cmake. The steps will be something like this:
1. install pypp
2. setup your project with cmd: `pypp init`
3. install any dependencies you want with cmd: `pypp install [name\]` (e.g. pypp install numpy)
4. run your code with the python interpreter with cmd: `python my_file.py`
5. transpile your code to C++ with cmd: `pypp transpile`
6. build the C++ code with
/r/Python
https://redd.it/1laf5ss
I am trying to gauge interest in this project, and I am also open to any advice people want to give. Here is the project github: https://github.com/curtispuetz/pypp
# Pypp (a Python to C++ transpiler)
This project is a work-in-progress. Below you will find sections: The goal, The idea (What My Project Does), How is this possible?, The inspiration (Target Audience), Why not cython, pypy, or Nuitka? (Comparison), and What works today?
## The goal
The primary goal of this project is to make the end-product of your Python projects execute faster.
## What My Project Does
The idea is to transpile your Python project into a C++ cmake project, which can be built and executed much faster, as C/C++ is the fastest high-level language of today.
You will be able to run your code either with the Python interpreter, or by transpiling it to C++ and then building it with cmake. The steps will be something like this:
1. install pypp
2. setup your project with cmd: `pypp init`
3. install any dependencies you want with cmd: `pypp install [name\]` (e.g. pypp install numpy)
4. run your code with the python interpreter with cmd: `python my_file.py`
5. transpile your code to C++ with cmd: `pypp transpile`
6. build the C++ code with
/r/Python
https://redd.it/1laf5ss
GitHub
GitHub - curtispuetz/pypp: python to C++ transpiler
python to C++ transpiler. Contribute to curtispuetz/pypp development by creating an account on GitHub.
open-source portfolio website with Django , TailwindCss & Alphin.js
https://redd.it/1la9u38
@pythondaily
https://redd.it/1la9u38
@pythondaily
Reddit
From the django community on Reddit: open-source portfolio website with Django , TailwindCss & Alphin.js
Explore this post and more from the django community
How do you guys secure your django websites?
recently i was working on a freelance project
i wrote a small function for deleting objects but each time i notice that there's something wrong and it was the lack if security and its driving me crazy that each time i have to implement a new security function
so my question is:
How do you guys implement the security features?
do you create all of the security features at once? or wait the production and user feedback?
https://preview.redd.it/lepcn95y5n6f1.png?width=1360&format=png&auto=webp&s=f59125378d9d256b372ad14c3a9c5dc04791b0de
/r/django
https://redd.it/1la9cc8
recently i was working on a freelance project
i wrote a small function for deleting objects but each time i notice that there's something wrong and it was the lack if security and its driving me crazy that each time i have to implement a new security function
so my question is:
How do you guys implement the security features?
do you create all of the security features at once? or wait the production and user feedback?
https://preview.redd.it/lepcn95y5n6f1.png?width=1360&format=png&auto=webp&s=f59125378d9d256b372ad14c3a9c5dc04791b0de
/r/django
https://redd.it/1la9cc8
[Project] I built an open-source tool to turn handwriting into a font using PyTorch and OpenCV.
I'm excited to share HandFonted, a project I built that uses a Python-powered backend to convert a photo of handwriting into an installable .ttf font file.
**Live Demo:** [https://handfonted.xyz](https://www.google.com/url?sa=E&q=https%3A%2F%2Fhandfonted.xyz)
**GitHub Repo:** [https://github.com/reshamgaire/HandFonted](https://github.com/reshamgaire/HandFonted)
**What My Project Does**
HandFonted is a web application that allows a user to upload a single image of their handwritten alphabet. The backend processes this image, isolates each character, identifies it using a machine learning model, and then generates a fully functional font file (.ttf) that the user can download and install on their computer.
**Target Audience**
This is primarily a portfolio project to demonstrate a full-stack application combining computer vision, ML, and web development. It's meant for:
* **Developers and students** to explore how these different technologies can be integrated.
* **Hobbyists and creatives** who want a fun, free tool to create a personal font without the complexity of professional software.
**How it Differs from Alternatives**
While there are commercial services like Calligraphr, HandFonted differs in a few key ways:
* **No Template Required:** You can write on any plain piece of paper, whereas many alternatives require you to print and fill out a specific template.
* **Fully Free & Open-Source:** There are no premium features or sign-ups. The entire codebase is available on GitHub for anyone to inspect, use, or learn from.
* **AI-Powered Recognition:** It
/r/Python
https://redd.it/1laipn1
I'm excited to share HandFonted, a project I built that uses a Python-powered backend to convert a photo of handwriting into an installable .ttf font file.
**Live Demo:** [https://handfonted.xyz](https://www.google.com/url?sa=E&q=https%3A%2F%2Fhandfonted.xyz)
**GitHub Repo:** [https://github.com/reshamgaire/HandFonted](https://github.com/reshamgaire/HandFonted)
**What My Project Does**
HandFonted is a web application that allows a user to upload a single image of their handwritten alphabet. The backend processes this image, isolates each character, identifies it using a machine learning model, and then generates a fully functional font file (.ttf) that the user can download and install on their computer.
**Target Audience**
This is primarily a portfolio project to demonstrate a full-stack application combining computer vision, ML, and web development. It's meant for:
* **Developers and students** to explore how these different technologies can be integrated.
* **Hobbyists and creatives** who want a fun, free tool to create a personal font without the complexity of professional software.
**How it Differs from Alternatives**
While there are commercial services like Calligraphr, HandFonted differs in a few key ways:
* **No Template Required:** You can write on any plain piece of paper, whereas many alternatives require you to print and fill out a specific template.
* **Fully Free & Open-Source:** There are no premium features or sign-ups. The entire codebase is available on GitHub for anyone to inspect, use, or learn from.
* **AI-Powered Recognition:** It
/r/Python
https://redd.it/1laipn1
GitHub
GitHub - reshamgaire/HandFonted: A Python tool to create a functional TrueType Font (.ttf) from an image of your handwriting using…
A Python tool to create a functional TrueType Font (.ttf) from an image of your handwriting using deep learning and computer vision. - reshamgaire/HandFonted
Django Channels
Hi so i need to implement notifications in my application and I have a few questions about Django channel layer(COuld really use some help here):
1. Does every consumer instance get its own channel layer name ? ( lets say i have 2 websocket URLs mapped to 2 consumers , and every client establishes a connection to both these consumers via the url router )
2. Is the channel layer name uniquely generated only for that specific connection ? and therefore might be different if the same consumer spins up another instance of itself for a connection ?
3. How do i store and access these channel layer names for each user when i need to add them to a group or something . Do i just store them in a database for the duration of the connection and get rid of them after ?
/r/django
https://redd.it/1lak6tk
Hi so i need to implement notifications in my application and I have a few questions about Django channel layer(COuld really use some help here):
1. Does every consumer instance get its own channel layer name ? ( lets say i have 2 websocket URLs mapped to 2 consumers , and every client establishes a connection to both these consumers via the url router )
2. Is the channel layer name uniquely generated only for that specific connection ? and therefore might be different if the same consumer spins up another instance of itself for a connection ?
3. How do i store and access these channel layer names for each user when i need to add them to a group or something . Do i just store them in a database for the duration of the connection and get rid of them after ?
/r/django
https://redd.it/1lak6tk
Reddit
From the django community on Reddit
Explore this post and more from the django community
I built a modern, AI-powered admin for Django using Next.js & shadcn/ui, and I'm looking for contributors!
https://redd.it/1lau7ln
@pythondaily
https://redd.it/1lau7ln
@pythondaily
Reddit
From the django community on Reddit: I built a modern, AI-powered admin for Django using Next.js & shadcn/ui, and I'm looking for…
Explore this post and more from the django community