Real-time chat application with Django + Firebase Cloud Messaging.
I need to create a real-time chat application where users can send messages, videos, pictures, voice messages, etc.
There will be one-to-one chats or group chats for users.
Now my question is about the tech stack, basically up until now I have been writing DRF API and I am thinking of using Django channels with FCM for push notifications and I wanted to know if this is a good idea or if I should do something else.
Also, I have heard about Firebase's real-time database and wanted to ask if I can use it instead of Django channels.
I am a beginner and a bit lost so please any recommendation or suggestion will be appreciated.
/r/django
https://redd.it/1ehnjqn
The trouble with all
https://www.gauge.sh/blog/the-trouble-with-all
I wrote a blog post discussing the issues that __all__
in Python has - particularly it's lack of ability to enforce public APIs despite letting you define them. It led to a fun exploration of importlib
and me writing my first import hook! Code here - https://github.com/gauge-sh/hook/blob/main/hook.py
Curious to hear folks thoughts on this problem, especially as compared to other languages! How do you enforce interfaces on your Python modules?
/r/Python
https://redd.it/1ehjy9g
Django Compose - Head start on development
Hello Everyone, 👋
I am excited to share with you, Django Compose 🚀
https://preview.redd.it/yo8y7518vufd1.png?width=3456&format=png&auto=webp&s=4c55579a1a33c74c22b9cda008c2bc890577e452
Django Compose shortens the time needed to create a full fledged Django project.
Build at the speed of no-code. Export to code and customise. Build fast not from scratch.
With few steps, you have 10x productivity which allows you focus on what matters (your business logic).
Create project: Describe your Django application or use our template.
Map your fields: Describe and Map your project's model schema (Entity Relations).
Configure what you want: Select technologies, features and dependencies you want.
Get your code: That's it. Your codebase is ready, with specified apps, models, views, templates, urls and much more configured for you, API and WEB 🪄.
Live now ✨
https://djangocompose.com
/r/django
https://redd.it/1eh8ndc
django-allauth 64.0.0 released: WebAuthn & Passkey support
https://allauth.org/news/2024/07/django-allauth-64.0.0-released/
/r/django
https://redd.it/1ehb6wb
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1eh2h8o
How many database rows can I have till Django starts to slow down?
How many rows can I have in my PostgreSQL database till Django starts to slow down? Each row has 9 columns. A single user can create as many as 1,000 rows.
/r/djangolearning
https://redd.it/1egpmcg
Best Resourse to learn Flask api?
i am asking for a tutorial for flask api which is the best way to learn it
/r/flask
https://redd.it/1eed9y8
D Is Unlimited Context Length really possible?: "Unlimiformer" author discusses NeurIPS paper Friday
Is Unlimited Context Length really possible? At what cost?
Amanda Bertsch, author of 2023 NeurIPS paper Unlimiformer, will describe the architecture and take questions at this Friday's Oxen.ai Paper Club.
Greg Schoeninger u/FallMindless3563, Oxen CEO and Master of Plain Speak, will help interp the concept and relate it to other papers we have reviewed.
Call: https://oxen.ai/community
The trick asserted to make Unlimited Context Length possible: Offload the cross attention calc to a K-Nearest Neighbors (K-NN) index.
I tweeted someone's clever animation of K-NN here: https://x.com/mustafarrag/status/1817647917059944474
Paper: https://arxiv.org/abs/2305.01625
Greg, I'll reply with my first 5 questions. I've only read the abstract so far.
/r/MachineLearning
https://redd.it/1egqitt
Mulitnomial Logistic model but for mixed effects
Hello, I wanted some suggestions on how to implement a mixed effects multinomial logistic regression model for my data.
A little context on my data- I am trying to predict how people categorize an object (4 possible options here - categorical) based on 2 types of inputs (both inputs are categorical variables with 4 different categories each).
Initially, I thought a normal multinomial logit model would work, but it was brought to my attention that I had repeated measures in my data. Which had me looking up mixed effects models.
But, mixed effects multinomial logistic regression for categorical variables sounds....complicated.
Any suggestions on how to implement this (packages/code samples etc) or any better/easier alternatives for this type of data, would be welcome.
/r/pystats
https://redd.it/1egqxsw
Claude playing nicer with django
If you use claude / chatgpt for working on django code, you probably already bumped into the problem that claude will guess the model fields for the models it can't see - producing crappy results.
To get around it, make a management command that describes models accross one or more apps, printing the description to console in a dense format.
Now claude doesn't make mistakes when he is referencing other models. Just ask claude for a list of the models he needs more information about before he starts working, copy the list into the management command and get a console log of the description in an dense format.
I'm interested in any other tricks people have to make claude or chatgpt play better with django.
Instructions and code...
Use it like this:
python manage.py describe_models model1 model2 model3
or
python manage.py describe_models app
or
python manage.py describe_models --all
Here is the management command:
#describemodels.py
from django.core.management.base import BaseCommand
from django.apps import apps
from django.db import models
MAXCHOICES = 10
class Command(BaseCommand):
help = 'Print schema of
/r/django
https://redd.it/1egi9ad
D Monthly Who's Hiring and Who wants to be Hired?
For Job Postings please use this template
>Hiring: [Location\], Salary:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] and [Brief overview, what you're looking for\]
For Those looking for jobs please use this template
>Want to be Hired: [Location\], Salary Expectation:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] Resume: [Link to resume\] and [Brief overview, what you're looking for\]
​
Please remember that this community is geared towards those with experience.
/r/MachineLearning
https://redd.it/1egc1um
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/1eg8uu9
Advice on Usage Limited Subscription Model Using Stripe Payments 🤑
What would be the best way to implement this, I feel that it is a fairly common business model but can't find any resources online. I am using stripe payments.
I believe I would require users to sign up immediately so I can track their usage.
I plan on offering a free trial e.g. 10 uses of my SaaS (each is an openai call).
Then if the user wants to continue using, they have to purchase a subscription.
When subscribed they have a maximum usage e.g. 100 uses per month.
Alternatively, is there a similar business model that I could implement with stripe which I can't be exploited by lots of openai api calls which could get expensive?
My current setup:
Flask backend
OpenAI API for summarization
Simple HTML/CSS/JS frontend
Stripe for payments
Any advice, resources, or code examples would be greatly appreciated. Thanks in advance!
/r/flask
https://redd.it/1eg0w49
ArchiveFile: Unified interface for tar, zip, sevenzip, and rar files
PREVIOUS POST
#### What My Project Doesarchivefile
is a wrapper around `tarfile`, `zipfile`, `py7zr`, and `rarfile`.
The above libraries are excellent when you are dealing with a single archive format but things quickly get annoying when you have a bunch of mixed archives such as .zip
, .7z
, .cbr
, .tar.gz
, etc because each library has a slightly different syntax and quirks which you need to deal with.archivefile
wraps the common methods from the above libraries to provide a unified interface that takes care of said differences under the hood. However, it's not as powerful as the libraries it wraps due to lack of support for features that are unique to a specific archive format and library.
#### Target audience
Anyone who's using python to deal with different archive formats
#### Comparison
- ZipFile, TarFile, RarFile, and py7zr - These are libraries that mine wraps since each of them can only deal with a single archive format
- shutil - Shutil can only deal with zipfile and tarfile and only allows full packing or full extraction.
- patool - Excellent library that deals with wider range of formats than mine but in doing so it provides less granular control over each
ArchiveFile falls somewhere between the powerful dedicated library and the
/r/Python
https://redd.it/1eg35qy
ENVKEY Shutting Down - Alternatives for secrets / keys?
Hey all, ENVKEY just announced they're shutting down. What is everyone using for secrets / keys?
Here is the email from ENVKEY:
>Today I have some difficult news to share. After nearly 7 years of working on EnvKey, I’ve decided to begin winding down the company. In order to give all customers and users plenty of time to transition away, EnvKey will wind down over the next 6 months. EnvKey Cloud will shut down on February 1st, 2025 and then the EnvKey company will be dissolved.
>This has been a stressful and emotional decision for me, but unfortunately I’ve had to accept that continuing to run EnvKey is no longer financially sustainable for myself and my family, and therefore it’s time to move on.
>I understand that this may come as a surprise and a disappointment. I’m deeply honored by the trust that hundreds of organizations and thousands of users have placed in EnvKey over the years, and I regret giving you extra work to do in transitioning away.
>I hope that the gradual wind down period will help to soften any negative impact. Additionally, I've been in touch with the CEO of Infisical, another secrets management platform that is also open source, end-to-end encrypted, and similar in its spirit and
/r/Python
https://redd.it/1ehny2x
Hosting Help
Hi, I have 3 sites pointing to 1 IP address hosted by Linode ubuntu. I did not have to do much when setting this up, all was auto filled by Linode when adding domain names.
I want to change my VPS from Linode to a new provider that supports only IPv4. The new service only gives me the vps, there is no interface like Linode where I can add domain names point to the VPS IP.
Could anyone provide guidance on how to setup my domains to point to my new vps IP?
my domains are with with 2x godaddy, 1x namecheap.
/r/flask
https://redd.it/1ehga1n
Anyone know of any communities dedicated to software toys?
By "software toys" I mean silly little applications/scripts/whatever that serve no purpose other than to amuse, but don't quite meet the definition of a game.
For example, I once wrote a Python script that encoded text as mosaic of colored squares.
Or another time I wrote a non-interactive simulation of a crew of NPCS that explored a fictional ocean and posted their discoveries on Reddit.
Just silly, dumb things like that. It doesn't necessarily have to be strictly for Python but since that's what I normally code in I thought I'd ask here.
Anyone know of any communities dedicated to software like that?
/r/Python
https://redd.it/1eh7rlg
How to upload your Django project on github safely?
what things should i hide before i put the project on github?
/r/django
https://redd.it/1eh0dqc
R Annotation Vocabulary (Might Be) All You Need
Paper link: https://www.biorxiv.org/content/10.1101/2024.07.30.605924v1
Abstract:
>
Protein Language Models (pLMs) have revolutionized the computational modeling of protein systems, building numerical embeddings that are centered around structural features. To enhance the breadth of biochemically relevant properties available in protein embeddings, we engineered the Annotation Vocabulary, a transformer readable language of protein properties defined by structured ontologies. We trained Annotation Transformers (AT) from the ground up to recover masked protein property inputs without reference to amino acid sequences, building a new numerical feature space on protein descriptions alone. We leverage AT representations in various model architectures, for both protein representation and generation. To showcase the merit of Annotation Vocabulary integration, we performed 515 diverse downstream experiments. Using a novel loss function and only $3 in commercial compute, our premier representation model CAMP produces state-of-the-art embeddings for five out of 15 common datasets with competitive performance on the rest; highlighting the computational efficiency of latent space curation with Annotation Vocabulary. To standardize the comparison of de novo generated protein sequences, we suggest a new sequence alignment-based score that is more flexible and biologically relevant than traditional language modeling metrics. Our generative model, GSM, produces high alignment scores from annotation-only prompts with a BERT-like generation scheme. Of particular
/r/MachineLearning
https://redd.it/1egthqg
Help for a Beginner
I am a Django learner made few websites now and i dont know the react or any other i dont understand when can i start for job hunting can anyone recommend what more skills do i need ...
/r/djangolearning
https://redd.it/1egvq2c
Component Library Solution: django-lookbook
Hi, I'd like to share an Django component library solution **django-lookbook** here.
I want something like "StoryBook" to Django but existing solutions of the Django community did not make me satisfied, so I built it myself.
Below are some features you might be interested:
## Pluggable app
It is a classic Django pluggable app which can be integrated with your Django project within minutes.
No matter your Django project use jQuery, Vanilla JS, Alpine.js, HTMX, Stimulus.js or other frontend solution, **it can work with them all**.
## Preview
Let's say you have a custom `Modal` component in your Django project, built with `Alpine.js`, and it supports different modal size `small`, `medium`, `large` based on the `Tailwind CSS`
How to make other team mates quickly understand the usage? Instead of digging the Django templates?
We can create three previews for the Modal and developers can directly check the final result in the component library.
class ModalComponentPreview:
def small_modal():
def medium_modal():
def large_modal():
As you can see, we can create previews and put them in one Python class, and the syntax is very similar with writing unittests
/r/django
https://redd.it/1egi8z3
Error while running the falsk app on development server
When I am adding Csrf to my Flask app and running the app on a development server
I am getting this error: {"error":"Port could not be cast to integer value as '4444,172.233.209.24'"} Can anyone help?
/r/flask
https://redd.it/1egk8x0
Survey Paper over Neuro-Symbolic AI with Knowledge Graphs
https://arxiv.org/pdf/2302.07200
/r/MachineLearning
https://redd.it/1egke1v
What are some unusual but useful Python libraries you've discovered?
Hey everyone! I'm always on the lookout for new and interesting Python libraries that might not be well-known but are incredibly useful. Recently, I stumbled upon Rich for beautiful console output and Pydantic for data validation, which have been game-changers for my projects. What are some of the lesser-known libraries you've discovered that you think more people should know about? Share your favorites and how you use them!
/r/Python
https://redd.it/1egg99j
Flask api for African proverbs
https://rapidapi.com/chirikutsikuda/api/afro-verbo
/r/flask
https://redd.it/1egfp0f
Flask for Campus Placements
Hey guys! I am a final-year college student and have worked on multiple Flask applications in the past. My college would have companies visiting the campus for placements in a few days. Based on Flask practice and learning, I feel petrified regarding what to expect from the interviewers and what to focus on. I would be extremely grateful if some suggestions based on / regardless of my projects could be given.
Also, I feel as if I am in a fix as I love Flask and wish to work on new projects, but then considering the time required to map out a project seems too irrational, so should I work on improving pre-existing projects or work on some basic new ones exploring more into the domain? Kindly let me know! Cheers!
GitHub for reference: https://github.com/RampageousRJ
P.S. - Please don't mind my deployed projects, have deployed on render which makes them painfully slow
/r/flask
https://redd.it/1ef5bqi
Frustrating series of failed deployments — suggestions?
I’m setting up a simple web app that uses Chroma (and thus requires an up to date sqlite3), and has some files that are necessarily over 300mb.
These two factors have caused a lot of trouble in finding a suitable, free deployment website as many of them don’t have the latest sqlite3 version and/or do not support file uploads of >100mb.
What services do you guys suggest?
/r/flask
https://redd.it/1efvjn8
D NeurIPS 2024 Paper Reviews
NeurIPS 2024 paper reviews are supposed to be released today. I thought to create a discussion thread for us to discuss any issue/complain/celebration or anything else.
There is so much noise in the reviews every year. Some good work that the authors are proud of might get a low score because of the noisy system, given that NeurIPS is growing so large these years. We should keep in mind that the work is still valuable no matter what the score is.
/r/MachineLearning
https://redd.it/1efscr2