The trouble with all
https://www.gauge.sh/blog/the-trouble-with-all
I wrote a blog post discussing the issues that
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
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.pyCurious 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
www.gauge.sh
The trouble with __all__ - Gauge - Solving the monolith/microservices dilemma
The trouble with __all__. Gauge is solving the monolith/microservices dilemma. We’re building tools to untangle codebases through incremental modularization. Our open-source toolkit supports defining and enforcing rules for interfaces and dependencies. By…
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
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
Infisical
Infisical is an open-source end-to-end platform to manage secrets and configuration across your team and infrastructure.
Infisical is all-in-one platform to securely manage application configuration and secrets across your team and infrastructure. Used by Fortune 500 enterprises, international governments, and fastest-growing startups.
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
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
Reddit
From the django community on Reddit
Explore this post and more from the django community
New interesting funeral brochure and donation website with django htmx my second project will django
https://anytribute.com
Hi this is my second project with Django
Can you check it up and give me your feedback. It’s free to use.
Stack
Django
Bootstrap
Htmx
Hyperscript
Django widgets tweeks
Djago all auth
/r/django
https://redd.it/1ehqomc
https://anytribute.com
Hi this is my second project with Django
Can you check it up and give me your feedback. It’s free to use.
Stack
Django
Bootstrap
Htmx
Hyperscript
Django widgets tweeks
Djago all auth
/r/django
https://redd.it/1ehqomc
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/1ehvu5t
# 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/1ehvu5t
Redditinc
Reddit Rules
Reddit Rules - Reddit
Jeremy Howard has announced FastHTML, Dynamic modern html pages using python!
https://fastht.ml
/r/flask
https://redd.it/1ei1dw1
https://fastht.ml
/r/flask
https://redd.it/1ei1dw1
fastht.ml
FastHTML
Modern web applications in pure Python
Best practice for including a ton of error checking in a functional api view?
Hi, I'm doing an integration which involves taking data from service A, parsing it, sending it to service B, then returning a response back to service A. Service A has given a list of error codes that it expects when my server detects specific issues, so I've implemented them, but found that the code I wrote is quite lengthy to read.
I have implemented permission classes for things like this before, like detecting an api key or something, but the problem here is that the error checks vary per endpoint slightly, so I'd be writing at best a permission class per endpoint. I suppose I could try to create a permission class which checks for any similar errors, but it would still not solve the issue of having a bunch of error checking sprinkled into the views. Creating a separate file that contains functions that check for the errors is possible, but I just want to get a sense of best practice here. There are 5 endpoints, and each have similar if/else blocks for error checking per service A's requirements.
Here is an example of the if/else block for the error checks that service A wants, any suggestions on refactoring
/r/django
https://redd.it/1ei316o
Hi, I'm doing an integration which involves taking data from service A, parsing it, sending it to service B, then returning a response back to service A. Service A has given a list of error codes that it expects when my server detects specific issues, so I've implemented them, but found that the code I wrote is quite lengthy to read.
I have implemented permission classes for things like this before, like detecting an api key or something, but the problem here is that the error checks vary per endpoint slightly, so I'd be writing at best a permission class per endpoint. I suppose I could try to create a permission class which checks for any similar errors, but it would still not solve the issue of having a bunch of error checking sprinkled into the views. Creating a separate file that contains functions that check for the errors is possible, but I just want to get a sense of best practice here. There are 5 endpoints, and each have similar if/else blocks for error checking per service A's requirements.
Here is an example of the if/else block for the error checks that service A wants, any suggestions on refactoring
/r/django
https://redd.it/1ei316o
Reddit
From the django community on Reddit
Explore this post and more from the django community
Picked up an old project again and upgraded to the latest dependencies. Now I receive this error: "The current Flask app is not registered with this 'SQLAlchemy' instance." and I cant wrap my head around it.
Hey folks, I picked up an old project of mine, upgraded the versions in my requiement file and I receive this odd error for something that must have worked years ago.
I'd like to explain what's going on by guiding you through one request that triggers it, but should work.
I's a request to see if the username that's used to sign-up already exists.
Requirements:
Flask==3.0.3
flasklogin==0.6.3
Flask-Migrate==4.0.7
flasksqlalchemy==3.1.1
requests==2.32.3
Werkzeug==3.0.3
dnspython==2.3.0
email-validator==1.3.1
urllib3==1.26.14
My app.py (simplified)
from flask import Flask, rendertemplate, makeresponse, sendfromdirectory, jsonify, request
from flasksqlalchemy import SQLAlchemy
from sqlalchemy import text
from flaskmigrate import Migrate
app.secretkey = b'supersecret'
app.config['SQLALCHEMYDATABASEURI'] = 'mysql+pymysql://dbuser:password@mariadb/kinda?charset=utf8mb4'
app.config['SQLALCHEMYTRACKMODIFICATIONS'] = False
app.config['SECURITYDEFAULTREMEMBERME'] = True
db = SQLAlchemy(app)
# Initialize Flask-Migrate
/r/flask
https://redd.it/1ei6p69
Hey folks, I picked up an old project of mine, upgraded the versions in my requiement file and I receive this odd error for something that must have worked years ago.
I'd like to explain what's going on by guiding you through one request that triggers it, but should work.
I's a request to see if the username that's used to sign-up already exists.
Requirements:
Flask==3.0.3
flasklogin==0.6.3
Flask-Migrate==4.0.7
flasksqlalchemy==3.1.1
requests==2.32.3
Werkzeug==3.0.3
dnspython==2.3.0
email-validator==1.3.1
urllib3==1.26.14
My app.py (simplified)
from flask import Flask, rendertemplate, makeresponse, sendfromdirectory, jsonify, request
from flasksqlalchemy import SQLAlchemy
from sqlalchemy import text
from flaskmigrate import Migrate
app.secretkey = b'supersecret'
app.config['SQLALCHEMYDATABASEURI'] = 'mysql+pymysql://dbuser:password@mariadb/kinda?charset=utf8mb4'
app.config['SQLALCHEMYTRACKMODIFICATIONS'] = False
app.config['SECURITYDEFAULTREMEMBERME'] = True
db = SQLAlchemy(app)
# Initialize Flask-Migrate
/r/flask
https://redd.it/1ei6p69
Reddit
Picked up an old project again and upgraded to the latest dependencies. Now I receive this error: "The current Flask app is not…
85K subscribers in the flask community. Flask is a Python micro-framework for web development. Flask is easy to get started with and a great way to…
help to deploy python api
I am building a fullstack application using MERN, there are some features in it which requires AI/ML, so I've integrated python with this project. I can deploy the Node.js on vercel, but don't know how do I deply the python, as vercel doesn't allows python deployment. please suggest me some good platforms, should be free, to deploy python.
thank you
/r/flask
https://redd.it/1ehmqwy
I am building a fullstack application using MERN, there are some features in it which requires AI/ML, so I've integrated python with this project. I can deploy the Node.js on vercel, but don't know how do I deply the python, as vercel doesn't allows python deployment. please suggest me some good platforms, should be free, to deploy python.
thank you
/r/flask
https://redd.it/1ehmqwy
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Django devs from Colombia, are you there ?
Hi guys what are you up to these days in Colombia, how is the django scene moving ? I'd love to connect with fellow django devs currently in Colombia 👋
/r/django
https://redd.it/1ei570j
Hi guys what are you up to these days in Colombia, how is the django scene moving ? I'd love to connect with fellow django devs currently in Colombia 👋
/r/django
https://redd.it/1ei570j
Reddit
From the django community on Reddit
Explore this post and more from the django community
Best Approach to Styling Django Forms
I am always struggling to style Django forms(field, label, field/form errors), how are you guys dealing with this? What will you propose as the best approach(or library)?
/r/django
https://redd.it/1eiazvx
I am always struggling to style Django forms(field, label, field/form errors), how are you guys dealing with this? What will you propose as the best approach(or library)?
/r/django
https://redd.it/1eiazvx
Reddit
From the django community on Reddit
Explore this post and more from the django community
making a api endpoint start a routine that fetches from external API
Hello everyone,
So I'm trying to make this thing where when this api point is called i fetch data from another external API to save.
I think the process must be somehow asincronous, in the way that when I call it I shouldn't wait for the whole thing to process and have it "running in the background" (I plan even to give a get call so that I can see the progress of a given routine).
How can I achieve this?
/r/django
https://redd.it/1eiafpw
Hello everyone,
So I'm trying to make this thing where when this api point is called i fetch data from another external API to save.
I think the process must be somehow asincronous, in the way that when I call it I shouldn't wait for the whole thing to process and have it "running in the background" (I plan even to give a get call so that I can see the progress of a given routine).
How can I achieve this?
/r/django
https://redd.it/1eiafpw
Reddit
From the django community on Reddit
Explore this post and more from the django community
Inertia JS equivalent for Django
I found Inertia JS to be a handy tool for using Laravel at the backend and React / Vue at the frontend without the hassle of building API.
Do we have similar solution in Django world ?
The inertia website says that we can use it with Django but it is fine tuned for Laravel.
/r/django
https://redd.it/1eie1pa
I found Inertia JS to be a handy tool for using Laravel at the backend and React / Vue at the frontend without the hassle of building API.
Do we have similar solution in Django world ?
The inertia website says that we can use it with Django but it is fine tuned for Laravel.
/r/django
https://redd.it/1eie1pa
Reddit
From the django community on Reddit
Explore this post and more from the django community
Developing Secure Mobile Applications: Tips and Best Practices
https://www.quickwayinfosystems.com/blog/best-practices-secure-mobile-applications/
/r/flask
https://redd.it/1ei9xhn
https://www.quickwayinfosystems.com/blog/best-practices-secure-mobile-applications/
/r/flask
https://redd.it/1ei9xhn
Quickway Infoystems
Developing Secure Mobile Applications: Tips and Best Practices
Learn essential tips and best practices for developing secure mobile applications. Ensure your app's security and protect user data effectively.
Compress JSON: the missing Python utility to read and write compressed JSONs.
**What My Project Does**
I have always found working with compressed JSON files cumbersome, as for the life of me I cannot recall how to use Python's compression utilities. Plus, when you need to handle multiple possible formats, the code gets ugly quickly.
Compress-json abstracts away the complexities of handling different compression formats, allowing you to focus on writing clean and maintainable code.
**Installation**
You can install compress-json quickly using pip:
pip install compress_json
**Examples**
Here's how you can use compress-json to compress and decompress JSON files with minimal effort. Here it uses automatic detection of the compression type:
import compress_json
# Your JSON data
data = {
"A": {
"B": "C"
}
}
# Dumping data to various compressed files
compress_json.dump(data, "data.json.gz") # gzip compression
compress_json.dump(data, "data.json.bz") # bz2 compression
compress_json.dump(data, "data.json.lzma") # lzma compression
/r/Python
https://redd.it/1ei8vl9
**What My Project Does**
I have always found working with compressed JSON files cumbersome, as for the life of me I cannot recall how to use Python's compression utilities. Plus, when you need to handle multiple possible formats, the code gets ugly quickly.
Compress-json abstracts away the complexities of handling different compression formats, allowing you to focus on writing clean and maintainable code.
**Installation**
You can install compress-json quickly using pip:
pip install compress_json
**Examples**
Here's how you can use compress-json to compress and decompress JSON files with minimal effort. Here it uses automatic detection of the compression type:
import compress_json
# Your JSON data
data = {
"A": {
"B": "C"
}
}
# Dumping data to various compressed files
compress_json.dump(data, "data.json.gz") # gzip compression
compress_json.dump(data, "data.json.bz") # bz2 compression
compress_json.dump(data, "data.json.lzma") # lzma compression
/r/Python
https://redd.it/1ei8vl9
Reddit
From the Python community on Reddit: Compress JSON: the missing Python utility to read and write compressed JSONs.
Explore this post and more from the Python community
Help in getting new project ideas, primarily backend based
I have created many app projects with django, DRF and channels, but I am sick of creating just basic CRUD/chat apps. Can you guys give me any ideas on more projects which are primarily backend based, can use different concepts, and domains/fields I can integrate them with ?
I don't want to create a Netflix or Amazon clone or something like that too. Please help me out here guys.
/r/django
https://redd.it/1eiid5m
I have created many app projects with django, DRF and channels, but I am sick of creating just basic CRUD/chat apps. Can you guys give me any ideas on more projects which are primarily backend based, can use different concepts, and domains/fields I can integrate them with ?
I don't want to create a Netflix or Amazon clone or something like that too. Please help me out here guys.
/r/django
https://redd.it/1eiid5m
Reddit
From the django community on Reddit
Explore this post and more from the django community
What are popular sites that use Django template engine?
I know Pinterest used Django in backend but I haven't seen any popular company site that uses Django's built in html template engine. Do you know any?
/r/django
https://redd.it/1ei94m9
I know Pinterest used Django in backend but I haven't seen any popular company site that uses Django's built in html template engine. Do you know any?
/r/django
https://redd.it/1ei94m9
Reddit
From the django community on Reddit
Explore this post and more from the django community
dir-assistant: Chat with your current directory's files using a local or API LLM.
# What my Project Does
Dir-assistant is a CLI LLM runner that chooses the best info from your current directory (recursively) to include with your prompt. It is designed to improve programmer efficiency by speeding research and automatically writing code. It has been tested on a repository with 900k lines of code, and it produced useful contextually aware code.
Demo gif (images are not allowed in r/Python)
Setup is quick:
pip install dir-assistant
dir-assistant models download-embed
dir-assistant models download-llm
cd directory/to/chat/with
dir-assistant
It works with almost all local and API LLMs.
Yesterday I released the first major release, 1.0.0, which added pip install support and many quality of life improvements. I am aiming to support more operating systems, so if you would like to help by testing, please submit a github issue with your results. Other contributions including PRs are welcome as well.
# Target Audience
Coders who want to improve productivity
# Comparison
Other LLM runners are not aware of your files, perform badly, or are designed for small snippets. Dir-assistant is the best solution currently available for large projects.
# GitHub
GitHub Link: https://github.com/curvedinf/dir-assistant/
/r/Python
https://redd.it/1eihaif
# What my Project Does
Dir-assistant is a CLI LLM runner that chooses the best info from your current directory (recursively) to include with your prompt. It is designed to improve programmer efficiency by speeding research and automatically writing code. It has been tested on a repository with 900k lines of code, and it produced useful contextually aware code.
Demo gif (images are not allowed in r/Python)
Setup is quick:
pip install dir-assistant
dir-assistant models download-embed
dir-assistant models download-llm
cd directory/to/chat/with
dir-assistant
It works with almost all local and API LLMs.
Yesterday I released the first major release, 1.0.0, which added pip install support and many quality of life improvements. I am aiming to support more operating systems, so if you would like to help by testing, please submit a github issue with your results. Other contributions including PRs are welcome as well.
# Target Audience
Coders who want to improve productivity
# Comparison
Other LLM runners are not aware of your files, perform badly, or are designed for small snippets. Dir-assistant is the best solution currently available for large projects.
# GitHub
GitHub Link: https://github.com/curvedinf/dir-assistant/
/r/Python
https://redd.it/1eihaif
GitHub
dir-assistant/demo.gif at main · curvedinf/dir-assistant
Chat with your current directory's files using a local or API LLM. - curvedinf/dir-assistant
D Is the new norm for NLP papers "prompt engineering" papers?
So many papers seem to essentially be "how can we make LLM 1 do this without training?" I haven't published in a while and have been in industry for the past few years. I recently joined a new company in a slightly more research-y position and am working with research scientists and graduate interns. I've noticed that every single one of them is working on something that I would have been reprimanded by my PI for in graduate school. Basically, "how can we make LLMs do this really complicated task without doing any training?" And perhaps somewhat unsurprisingly, in many cases, you can't. I think that's why these days there are so many negative result papers in NLP.
Is this the new norm? It's become a pain to go through the CL section of arXiv. 98% of the papers are something like "how come LLaMA can't understand numbers?"
I'm wondering if I'm just being the senile old man in the corner of the bar or if everyone else feels the same.
/r/MachineLearning
https://redd.it/1ei9e3l
So many papers seem to essentially be "how can we make LLM 1 do this without training?" I haven't published in a while and have been in industry for the past few years. I recently joined a new company in a slightly more research-y position and am working with research scientists and graduate interns. I've noticed that every single one of them is working on something that I would have been reprimanded by my PI for in graduate school. Basically, "how can we make LLMs do this really complicated task without doing any training?" And perhaps somewhat unsurprisingly, in many cases, you can't. I think that's why these days there are so many negative result papers in NLP.
Is this the new norm? It's become a pain to go through the CL section of arXiv. 98% of the papers are something like "how come LLaMA can't understand numbers?"
I'm wondering if I'm just being the senile old man in the corner of the bar or if everyone else feels the same.
/r/MachineLearning
https://redd.it/1ei9e3l
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
Which famous sites use Django's built-in template engine?
There are many famous companies that use Django as backend framework but I haven't seen companies that use Django's built-in template engine. Do you know any?
/r/djangolearning
https://redd.it/1eiekxe
There are many famous companies that use Django as backend framework but I haven't seen companies that use Django's built-in template engine. Do you know any?
/r/djangolearning
https://redd.it/1eiekxe
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community