Services and Utilities: Best practice?
Hello all,
Been learning Django for a year or so and working on two production apps. What's your best practice with the location of service or utility functions? I'm looking at two options;
1. Utils folder at the same level as my apps -> utils/services.py
2. App level service layer -> my_app/services.py
Thanks all!
/r/django
https://redd.it/1f1002k
Hello all,
Been learning Django for a year or so and working on two production apps. What's your best practice with the location of service or utility functions? I'm looking at two options;
1. Utils folder at the same level as my apps -> utils/services.py
2. App level service layer -> my_app/services.py
Thanks all!
/r/django
https://redd.it/1f1002k
Reddit
From the django community on Reddit
Explore this post and more from the django community
Google News Scraping
Hello, I'm conducting research that involves collecting data from Google News. My goal is to determine how many times a country is mentioned in the titles of specific news websites. The query might look like this: 'intitle:[Country name\] site:[Website.com\]'. After running the query, I need to count the number of results. Doing this manually would take a long time, so I'm looking for an automated solution.
/r/Python
https://redd.it/1f0mvhl
Hello, I'm conducting research that involves collecting data from Google News. My goal is to determine how many times a country is mentioned in the titles of specific news websites. The query might look like this: 'intitle:[Country name\] site:[Website.com\]'. After running the query, I need to count the number of results. Doing this manually would take a long time, so I'm looking for an automated solution.
/r/Python
https://redd.it/1f0mvhl
Reddit
From the Python community on Reddit
Explore this post and more from the Python 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 description 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
**Description**: 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
**Description**: 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
**Description**: Create a script 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/1f1anh6
# 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 description 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
**Description**: 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
**Description**: 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
**Description**: Create a script 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/1f1anh6
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…
In flask I have a function that updates different columns in flask sqlalchemy but the columns won't update. Put simply the update doesn't have any effect on the code. What am I doing wrong?
return redirect(url_for('auth.login'))
return redirect(url_for('auth.login'))
# now is added because of pytest + now represents the current time
def reset_attempts_token_tried_to_0(user_db, now):
'''
if the max attempts of the token tried is exceeded + the
token is expired reset the attempts_token_tried to 0.
'''
# why doesn't work
time_token_expired_db = user_db.time_token_expired
# executes at 9:00 <= 9:30pm
current_time = now
#delete
flash(f'user_db.attempts_token_tried {user_db.attempts_token_tried}')
flash(f'current_time {current_time}')
flash(f'time_token_expired_db {time_token_expired_db}')
/r/flask
https://redd.it/1f14zga
return redirect(url_for('auth.login'))
return redirect(url_for('auth.login'))
# now is added because of pytest + now represents the current time
def reset_attempts_token_tried_to_0(user_db, now):
'''
if the max attempts of the token tried is exceeded + the
token is expired reset the attempts_token_tried to 0.
'''
# why doesn't work
time_token_expired_db = user_db.time_token_expired
# executes at 9:00 <= 9:30pm
current_time = now
#delete
flash(f'user_db.attempts_token_tried {user_db.attempts_token_tried}')
flash(f'current_time {current_time}')
flash(f'time_token_expired_db {time_token_expired_db}')
/r/flask
https://redd.it/1f14zga
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Giving OTP sms
I wanted to implement OTP service on my django project so is there any free service for this to implement it
/r/django
https://redd.it/1f1csmd
I wanted to implement OTP service on my django project so is there any free service for this to implement it
/r/django
https://redd.it/1f1csmd
Reddit
From the django community on Reddit
Explore this post and more from the django community
Hiring Full Stack Developer
Hi developers, we have added a new job listing on our platform. If you are interested in this job please check the job link below.
Role - Full Stack Developer (Remote, Full Time)
Job Link - devloprr.com/jobs#288
/r/flask
https://redd.it/1f1fp81
Hi developers, we have added a new job listing on our platform. If you are interested in this job please check the job link below.
Role - Full Stack Developer (Remote, Full Time)
Job Link - devloprr.com/jobs#288
/r/flask
https://redd.it/1f1fp81
Devloprr
Login - devloprr.com
devloprr.com is a new social media and collaboration platform created for Developers/programmers where developers can create account, blogs and post short content and long articles and earn money from Monetization as well.
I am getting the following error. "AttributeError: 'NoneType' object has no attribute 'save'.
error:
Traceback (most recent call last):
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 1498, in __call__
return self.wsgi_app(environ, start_response)
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 1476, in wsgi_app
response = self.handle_exception(e)
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint\])(**view_args) # type: ignore[no-any-return\]
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask_login\\utils.py", line 290, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "e:\\newsPortal\\website\\views.py", line 23, in create_post
image.save('images/' + img + '.jpg')
AttributeError: 'NoneType' object has no attribute 'save'
python:
@views.route("/createpost", methods=['GET', 'POST'])
@loginrequired
def createpost():
if request.method == "POST":
text = request.form.get('text')
img = str(uuid.uuid4())
image = request.files.get('image')
imagefilename
/r/flask
https://redd.it/1f1hhdt
error:
Traceback (most recent call last):
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 1498, in __call__
return self.wsgi_app(environ, start_response)
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 1476, in wsgi_app
response = self.handle_exception(e)
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask\\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint\])(**view_args) # type: ignore[no-any-return\]
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\mmhta\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\flask_login\\utils.py", line 290, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^
File "e:\\newsPortal\\website\\views.py", line 23, in create_post
image.save('images/' + img + '.jpg')
AttributeError: 'NoneType' object has no attribute 'save'
python:
@views.route("/createpost", methods=['GET', 'POST'])
@loginrequired
def createpost():
if request.method == "POST":
text = request.form.get('text')
img = str(uuid.uuid4())
image = request.files.get('image')
imagefilename
/r/flask
https://redd.it/1f1hhdt
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
picows: Fast websocket client and server for asyncio
https://github.com/tarasko/picows
# What My Project Does
picows is a high-performance open-source python library designed for building asyncio WebSocket clients and servers. Implemented in Cython, it offers exceptional speed and efficiency, surpassing other popular WebSocket python libraries.
# Target Audience
Production
# Comparison
picows is 1.5\~2.0 faster than aiohttp and 2.5\~3.5 times faster than websockets in a simple echo test. See benchmark result on the project github page.
# Distinctive features
Maximally efficient WebSocket frame parser and builder implemented in Cython
Re-use memory as much as possible, avoid reallocations, and avoid unnecessary Python object creations
Provide Cython .pxd for efficient integration of user Cythonized code with picows
Ability to check if a frame is the last one in the receiving buffer
/r/Python
https://redd.it/1f1eydk
https://github.com/tarasko/picows
# What My Project Does
picows is a high-performance open-source python library designed for building asyncio WebSocket clients and servers. Implemented in Cython, it offers exceptional speed and efficiency, surpassing other popular WebSocket python libraries.
# Target Audience
Production
# Comparison
picows is 1.5\~2.0 faster than aiohttp and 2.5\~3.5 times faster than websockets in a simple echo test. See benchmark result on the project github page.
# Distinctive features
Maximally efficient WebSocket frame parser and builder implemented in Cython
Re-use memory as much as possible, avoid reallocations, and avoid unnecessary Python object creations
Provide Cython .pxd for efficient integration of user Cythonized code with picows
Ability to check if a frame is the last one in the receiving buffer
/r/Python
https://redd.it/1f1eydk
GitHub
GitHub - tarasko/picows: Ultra-fast websocket client and server for asyncio
Ultra-fast websocket client and server for asyncio - tarasko/picows
Adding sockets/channels to an existing DRF deployment that uses gunicorn
My app has gotten to the point where I need some kind of two way communication between the frontend client and backend DRF app. I suppose I can get away for a while with polling for new data/events, but this is more of a bandaid that probably won't scale well as the app grows.
Does anyone have any input on how to add this extra layer to the app? My API is deployed in an ECS cluster and runs with gunicorn, so I was thinking that I deploy another service that runs with daphne or something and just modify the load balancer to direct socket traffic to another target group - but I'm also wondering about the possiblity of modifying the existing service to use daphne or uvicorn or something instead and foregoing gunicorn.
Any input on running both? Or if it's better to stick to one approach?
/r/django
https://redd.it/1f1jxs1
My app has gotten to the point where I need some kind of two way communication between the frontend client and backend DRF app. I suppose I can get away for a while with polling for new data/events, but this is more of a bandaid that probably won't scale well as the app grows.
Does anyone have any input on how to add this extra layer to the app? My API is deployed in an ECS cluster and runs with gunicorn, so I was thinking that I deploy another service that runs with daphne or something and just modify the load balancer to direct socket traffic to another target group - but I'm also wondering about the possiblity of modifying the existing service to use daphne or uvicorn or something instead and foregoing gunicorn.
Any input on running both? Or if it's better to stick to one approach?
/r/django
https://redd.it/1f1jxs1
Reddit
From the django community on Reddit
Explore this post and more from the django community
Need Help with Hosting My First Flask Application on Apache - Seeking Advice
Hi everyone,
This is my first time hosting an application, and I could really use some guidance. I'll be hosting my Flask app on a physical server that's running Apache, but I'm a bit unsure about the best approach. Here are some of my main questions:
1. Apache vs. Gunicorn: Should I run Apache as a reverse proxy with a WSGI server like Gunicorn, or would it be sufficient to use Apache with
2. Flask App Configuration: What specific code or configurations should I add to my Flask app to ensure it's production-ready? Are there best practices for setting environment variables, logging, and managing static files that I should follow?
3. Security Concerns: I've protected my routes from CSRF and used SQLAlchemy for my database interactions. I'm also considering using Flask-Talisman for enforcing HTTPS. Are there other critical security measures I should implement? What are some common security pitfalls I should avoid?
4. Critical Aspects of Hosting: What do you think are the most critical aspects I should focus on when hosting my app? Are there particular topics or technologies I should study to ensure my app is secure, reliable, and performant?
5. Deployment and
/r/flask
https://redd.it/1f0ujrz
Hi everyone,
This is my first time hosting an application, and I could really use some guidance. I'll be hosting my Flask app on a physical server that's running Apache, but I'm a bit unsure about the best approach. Here are some of my main questions:
1. Apache vs. Gunicorn: Should I run Apache as a reverse proxy with a WSGI server like Gunicorn, or would it be sufficient to use Apache with
mod_wsgi alone? What are the pros and cons of each setup?2. Flask App Configuration: What specific code or configurations should I add to my Flask app to ensure it's production-ready? Are there best practices for setting environment variables, logging, and managing static files that I should follow?
3. Security Concerns: I've protected my routes from CSRF and used SQLAlchemy for my database interactions. I'm also considering using Flask-Talisman for enforcing HTTPS. Are there other critical security measures I should implement? What are some common security pitfalls I should avoid?
4. Critical Aspects of Hosting: What do you think are the most critical aspects I should focus on when hosting my app? Are there particular topics or technologies I should study to ensure my app is secure, reliable, and performant?
5. Deployment and
/r/flask
https://redd.it/1f0ujrz
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
What do you think: validating JSONFields with a DRF serializer on create and update
Hello all. I'm working on a project where I need to create a custom "data storage" model for a client. The model will consist mainly of a couple JSONFields and some relational fields. There is a need for the JSONFields to fulfill a schema, and I would like to enforce it at all times. I got an idea for it, but now I stopped to think whether it is reasonable.
Django JSONFields do not have a way to support serializers or schemas at the moment. My idea is to subclass the models.JSONField to take a serializer class as an argument, and run the validation in field.validate() function. I will create serializers for each of the fields. On model save and update and so on, I will call serializer.is_valid() for each of the JSONFields, and save serializer.validated_data on the fields. This would allow me to enforce the schema and check that all required data is present, and that no extra data is saved.
I will also create a custom manager class and a queryset class to run validation on update and bulk_update etc that do not use object.save().
What do you think, does this sound too crazy? Does it go against some conventions, is
/r/django
https://redd.it/1f1khwc
Hello all. I'm working on a project where I need to create a custom "data storage" model for a client. The model will consist mainly of a couple JSONFields and some relational fields. There is a need for the JSONFields to fulfill a schema, and I would like to enforce it at all times. I got an idea for it, but now I stopped to think whether it is reasonable.
Django JSONFields do not have a way to support serializers or schemas at the moment. My idea is to subclass the models.JSONField to take a serializer class as an argument, and run the validation in field.validate() function. I will create serializers for each of the fields. On model save and update and so on, I will call serializer.is_valid() for each of the JSONFields, and save serializer.validated_data on the fields. This would allow me to enforce the schema and check that all required data is present, and that no extra data is saved.
I will also create a custom manager class and a queryset class to run validation on update and bulk_update etc that do not use object.save().
What do you think, does this sound too crazy? Does it go against some conventions, is
/r/django
https://redd.it/1f1khwc
Reddit
From the django community on Reddit
Explore this post and more from the django community
I love the Python community
Or maybe it’s just computer programming subreddits in general, but since I’ve only known Python I can really only comment on that.
Always sharing knowledge and supporting each other.
It’s quite literally what academia was always supposed to be about. The pursuit of greater knowledge, by all and for all.
/r/Python
https://redd.it/1f1kjpl
Or maybe it’s just computer programming subreddits in general, but since I’ve only known Python I can really only comment on that.
Always sharing knowledge and supporting each other.
It’s quite literally what academia was always supposed to be about. The pursuit of greater knowledge, by all and for all.
/r/Python
https://redd.it/1f1kjpl
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Our pre-commits enforce single-quotes. Is that horrible or is it just me?
I'm working in a bunch of repos that have a pre-commit that automatically turns double-quoted strings into single-quoted strings. Including the ones that are there because previous committers (somewhat understandably) didn't use the pre-commit, and ones that are there because I used the default vscode formatter (I believe other formatters generally have no preference or enforce double-quotes, by default). I'm finding it one of the more annoying aspects of working in these repos.
If you're working on your own then obviously do what thou wilt, but for teams of people working in multiple projects / repos (that may employ more normal policies) it seems downright antisocial. Or, maybe there's some niche where this is SOP? AITA?
Edit: Is this one of those subs where everything gets randomly downvoted, or do people actually hate this?
Edit2: To be clear, I'm 100% in favour of
Edit3: Hard to know exactly what to make of the mass downvotes and slew of contradictory unsolicited advice. I think maybe my main takeaway is that single-quotes have a lot more fans than I was aware of. Thanks
/r/Python
https://redd.it/1f1mica
I'm working in a bunch of repos that have a pre-commit that automatically turns double-quoted strings into single-quoted strings. Including the ones that are there because previous committers (somewhat understandably) didn't use the pre-commit, and ones that are there because I used the default vscode formatter (I believe other formatters generally have no preference or enforce double-quotes, by default). I'm finding it one of the more annoying aspects of working in these repos.
If you're working on your own then obviously do what thou wilt, but for teams of people working in multiple projects / repos (that may employ more normal policies) it seems downright antisocial. Or, maybe there's some niche where this is SOP? AITA?
Edit: Is this one of those subs where everything gets randomly downvoted, or do people actually hate this?
Edit2: To be clear, I'm 100% in favour of
pre-commit hooks. I just would rather they enforced (what seems to me to be) the convention, rather than the opposite of it.Edit3: Hard to know exactly what to make of the mass downvotes and slew of contradictory unsolicited advice. I think maybe my main takeaway is that single-quotes have a lot more fans than I was aware of. Thanks
/r/Python
https://redd.it/1f1mica
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
I just finished working on my biggest coding project, and It's for creating content using automation!
I've been working for the last two months on my SaaS for creating content, and I would like to get your opinion guys, that'll mean a lot to me!
It uses moviepy under the hood, (Backend) to process videos and edit, and Flask to serve user data, I've build it as an API, to give other users access to integrate it to their software in the future! but for now I'm focusing on getting the first version of it out! As they say: If you're not embarrassed by the First version of your product, you’ve launched too late.
Link: https://oclipia.com
https://preview.redd.it/v5l6rkg721ld1.png?width=2880&format=png&auto=webp&s=893770cda94c6fda3b7792bcf635549b512955d3
/r/flask
https://redd.it/1f1r5bd
I've been working for the last two months on my SaaS for creating content, and I would like to get your opinion guys, that'll mean a lot to me!
It uses moviepy under the hood, (Backend) to process videos and edit, and Flask to serve user data, I've build it as an API, to give other users access to integrate it to their software in the future! but for now I'm focusing on getting the first version of it out! As they say: If you're not embarrassed by the First version of your product, you’ve launched too late.
Link: https://oclipia.com
https://preview.redd.it/v5l6rkg721ld1.png?width=2880&format=png&auto=webp&s=893770cda94c6fda3b7792bcf635549b512955d3
/r/flask
https://redd.it/1f1r5bd
Oclipia
ReelsBuilder AI
The ultimate tool for creating AI-driven content, in minutes! Discover niches generated using our AI, Motivational, Short clips, Reddit stories, and much more!
Wave Function with arbitrary precision.
The Fast Wave package I developed for calculating the time-independent wave function of a Quantum Harmonic Oscillator now includes a new module for arbitrary precision wave function calculations. This module retains the functionality of the original but utilizes Python’s mpmath (https://mpmath.org/) package to control precision. Check it out: https://github.com/fobos123deimos/fast-wave/tree/main/src/fast\_wave
/r/Python
https://redd.it/1f1xy3d
The Fast Wave package I developed for calculating the time-independent wave function of a Quantum Harmonic Oscillator now includes a new module for arbitrary precision wave function calculations. This module retains the functionality of the original but utilizes Python’s mpmath (https://mpmath.org/) package to control precision. Check it out: https://github.com/fobos123deimos/fast-wave/tree/main/src/fast\_wave
/r/Python
https://redd.it/1f1xy3d
GitHub
fast-wave/src/fast_wave at main · fobos123deimos/fast-wave
Repository of the package Fast Wave. Contribute to fobos123deimos/fast-wave development by creating an account on GitHub.
Am I on the Right Path for Building an AI-Driven WhatsApp Chatbot for My Small Car Wash Business?
Is My Approach for an AI-Powered WhatsApp Chatbot for My Small Business on the Right Track?
Hi everyone,
I run a small eco-friendly car wash and I'm building a WhatsApp chatbot to automate customer inquiries like hours, pricing, and location. The goal is to make it feel human-like, not just like a typical bot.
# My Current Approach:
1. Hosting: Using PythonAnywhere for simplicity and affordability.
2. AI Integration: Leveraging the Together API with the LLaMA 405B model to generate responses. The chatbot is fed specific business information (hours, pricing, etc.) to ensure accurate answers.
3. Prompt Engineering: I've tailored prompts to make sure the chatbot only answers the customer’s question without sounding like a language model—keeping the interaction focused and human-like.
4. WhatsApp Integration: Using the WhatsApp Business API to receive and respond to customer messages directly based on predefined business context.
# My Questions:
1. Is PythonAnywhere suitable for this, or should I consider another platform for scalability?
2. Is the LLaMA 405B model the right choice for handling these simple queries? I found that the 70B model doesn't perform as well for all my cases
3. What challenges might I face in maintaining and scaling this chatbot?
4. Is there a more efficient or cost-effective way to implement this
/r/flask
https://redd.it/1f1waut
Is My Approach for an AI-Powered WhatsApp Chatbot for My Small Business on the Right Track?
Hi everyone,
I run a small eco-friendly car wash and I'm building a WhatsApp chatbot to automate customer inquiries like hours, pricing, and location. The goal is to make it feel human-like, not just like a typical bot.
# My Current Approach:
1. Hosting: Using PythonAnywhere for simplicity and affordability.
2. AI Integration: Leveraging the Together API with the LLaMA 405B model to generate responses. The chatbot is fed specific business information (hours, pricing, etc.) to ensure accurate answers.
3. Prompt Engineering: I've tailored prompts to make sure the chatbot only answers the customer’s question without sounding like a language model—keeping the interaction focused and human-like.
4. WhatsApp Integration: Using the WhatsApp Business API to receive and respond to customer messages directly based on predefined business context.
# My Questions:
1. Is PythonAnywhere suitable for this, or should I consider another platform for scalability?
2. Is the LLaMA 405B model the right choice for handling these simple queries? I found that the 70B model doesn't perform as well for all my cases
3. What challenges might I face in maintaining and scaling this chatbot?
4. Is there a more efficient or cost-effective way to implement this
/r/flask
https://redd.it/1f1waut
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
I updated the scraper for my Rockbusters game and went from 311 clues to 5,200 clues.
Website: https://www.jimmyrustles.com/rockbusters
Github: https://github.com/sgriffin53/rockbusters (the database scraper is scraper_db.py)
**What my project does**
This is a web game based on Karl Pilkington's Rockbusters game on his radio show. You're given a clue based on a band and some initials and you have to guess what the band is based on the clue and the initials. The clues were all scraped from /r/rockbusters and it guessed the correct answer for each clue based on which bands were mentioned most in the comments.
When I originally made this two years ago, it only had around 180 clues, I recently updated it to 310 clues, but that was about as far as I could get by scraping reddit directly.
I found a torrent with the posts from the top 20k subreddits up to June 2022. This had 10.7k posts from /r/rockbusters which was perfect for finding clues for my game.
I made a new scraper that scrapes the database, but I added a new feature. Originally, it had a predefined list of bands that it would try to match in the comments, but it'd miss out many bands because they weren't on its list. I changed it so that if it sees a set of words that match the
/r/Python
https://redd.it/1f210q0
Website: https://www.jimmyrustles.com/rockbusters
Github: https://github.com/sgriffin53/rockbusters (the database scraper is scraper_db.py)
**What my project does**
This is a web game based on Karl Pilkington's Rockbusters game on his radio show. You're given a clue based on a band and some initials and you have to guess what the band is based on the clue and the initials. The clues were all scraped from /r/rockbusters and it guessed the correct answer for each clue based on which bands were mentioned most in the comments.
When I originally made this two years ago, it only had around 180 clues, I recently updated it to 310 clues, but that was about as far as I could get by scraping reddit directly.
I found a torrent with the posts from the top 20k subreddits up to June 2022. This had 10.7k posts from /r/rockbusters which was perfect for finding clues for my game.
I made a new scraper that scrapes the database, but I added a new feature. Originally, it had a predefined list of bands that it would try to match in the comments, but it'd miss out many bands because they weren't on its list. I changed it so that if it sees a set of words that match the
/r/Python
https://redd.it/1f210q0
GitHub
GitHub - sgriffin53/rockbusters: Rockbusters game in python and flask
Rockbusters game in python and flask. Contribute to sgriffin53/rockbusters development by creating an account on GitHub.
Looking for feedback on rpaudio—a Rust Python binding for audio playback!
Target Audience:
This tool is aimed at Python developers who are interested in audio playback functionality, but I’d love to get feedback from anyone experienced with Rust and Python bindings.
What It Does:
I’ve been working on
I built this because I wanted a way to use Rust’s power in Python projects without having to deal with the usual awkwardness that come with Python’s GIL. It’s especially useful if you’re working on projects that need to handle audio in async applications.
Why I Think It’s Useful:
I've experienced difficulties with other audio libraries, particularly in the installation department, so this was an exploration in trying to solve those issues and I used Rust because of its handling of concurrency, as well as support for building python bindings easily on multiple OS's.
Comparison:
Pyaudio and other popular libraries like it, dont seem to support async functionality, which is one of the ways I normally like to interact
/r/Python
https://redd.it/1f21efd
Target Audience:
This tool is aimed at Python developers who are interested in audio playback functionality, but I’d love to get feedback from anyone experienced with Rust and Python bindings.
What It Does:
I’ve been working on
rpaudio, a Python binding built with Rust that provides efficient/simple audio management capabilities. It’s designed to mimic how an actual hardware audio mixer might conceptually work. The library includes features like audio playback, pausing, and resuming, channels (queues) and a Manager class for channels. Its integrated in Python using PyO3 and maturin.I built this because I wanted a way to use Rust’s power in Python projects without having to deal with the usual awkwardness that come with Python’s GIL. It’s especially useful if you’re working on projects that need to handle audio in async applications.
Why I Think It’s Useful:
I've experienced difficulties with other audio libraries, particularly in the installation department, so this was an exploration in trying to solve those issues and I used Rust because of its handling of concurrency, as well as support for building python bindings easily on multiple OS's.
Comparison:
Pyaudio and other popular libraries like it, dont seem to support async functionality, which is one of the ways I normally like to interact
/r/Python
https://redd.it/1f21efd
PyPI
PyAudio
Cross-platform audio I/O with PortAudio
Tuesday Daily Thread: Advanced questions
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1f237eq
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1f237eq
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
If you could go back, would you still learn django?
If you could go back to yourself when you were picking what framework to learn, would you still choose django? if not why and what would the other framework be?
/r/django
https://redd.it/1f25vtp
If you could go back to yourself when you were picking what framework to learn, would you still choose django? if not why and what would the other framework be?
/r/django
https://redd.it/1f25vtp
Reddit
From the django community on Reddit
Explore this post and more from the django community