Monday Daily Thread: Project ideas!
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/12h0ihl
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/12h0ihl
Reddit
r/Python on Reddit: Monday Daily Thread: Project ideas!
Posted by u/Im__Joseph - No votes and no comments
Comprehensive Reddit Saved Posts Downloader - retrieves almost all content ever saved
Hi all, I made a post about this a couple of days ago, but I've made some pretty massive changes since then and I wanted to share it again. I'm super happy with the results.
To recap, this program backs up all of your saved posts on Reddit, obtaining media such as Reddit galleries, Imgur albums, gifs, videos, etc. It stores a local log of all of the files downloaded/skipped.
Since last posting, I've added the ability to load your entire saved post record using information provided by Reddit. However, I noticed that a lot of the content had been deleted or removed, making up about a quarter of all my posts. So now I've implemented the ability to retrieve this information from pushshift and the wayback machine, and it works very well. For reference, I downloaded about 3500 posts from 5+ years back and only had around 200 fail.
Let me know how my code looks and if there's anything I could improve on. Thanks!
https://github.com/aeluro1/geddit
/r/Python
https://redd.it/12fzdu2
Hi all, I made a post about this a couple of days ago, but I've made some pretty massive changes since then and I wanted to share it again. I'm super happy with the results.
To recap, this program backs up all of your saved posts on Reddit, obtaining media such as Reddit galleries, Imgur albums, gifs, videos, etc. It stores a local log of all of the files downloaded/skipped.
Since last posting, I've added the ability to load your entire saved post record using information provided by Reddit. However, I noticed that a lot of the content had been deleted or removed, making up about a quarter of all my posts. So now I've implemented the ability to retrieve this information from pushshift and the wayback machine, and it works very well. For reference, I downloaded about 3500 posts from 5+ years back and only had around 200 fail.
Let me know how my code looks and if there's anything I could improve on. Thanks!
https://github.com/aeluro1/geddit
/r/Python
https://redd.it/12fzdu2
GitHub
GitHub - aeluro1/geddit: Reddit Content Manager
Reddit Content Manager. Contribute to aeluro1/geddit development by creating an account on GitHub.
Using flask, I made a word puzzle game, Syllacrostic. Please let me know what you think, there is a new puzzle daily.
http://www.syllacrostic.com
/r/flask
https://redd.it/12gqize
http://www.syllacrostic.com
/r/flask
https://redd.it/12gqize
Syllacrostic
Syllacrostic is a free, daily word puzzle that challenges your vocabulary and critical thinking skills.
DRF Performance (How bad is this code?)
Hello, I'm building out a web app for construction companies. My stack is currently nginx -> nextjs -> DRF. Everything runs super smoothly when ever there are only 2-5 users active. However when running a loadster test and running 15 concurrent bots with basic actions on the app . It gets super slow. I mean like after 2 minutes of stress testing the app becomes unusuable and endpoints take \~15 seconds to respond. I also added django slik to understand whats happening. First I thought it was my badly written endpoints, but after optimising them and seeing what silky had to say - I can't quite understand what's happening.
The couple last super slow request of the stress test:
https://preview.redd.it/w5uaxz062ysa1.png?width=1749&format=png&auto=webp&v=enabled&s=1202a1bb21a99cbaed6f26217da94426b73ca25e
As you can see the time spent on queries is not too bad. If we take a look for example at the 15s endpoint(first one from the silk screenshot) it's pretty simple in princible imo.
class GetOrderItems(APIView):
permission_classes = [OrderItemIsPartOfCompany | WorkerIsPartOfCompany]
@silk_profile(name='Get OrdersItems for Order')
def get(self, request, order_id):
/r/django
https://redd.it/12h0kf1
Hello, I'm building out a web app for construction companies. My stack is currently nginx -> nextjs -> DRF. Everything runs super smoothly when ever there are only 2-5 users active. However when running a loadster test and running 15 concurrent bots with basic actions on the app . It gets super slow. I mean like after 2 minutes of stress testing the app becomes unusuable and endpoints take \~15 seconds to respond. I also added django slik to understand whats happening. First I thought it was my badly written endpoints, but after optimising them and seeing what silky had to say - I can't quite understand what's happening.
The couple last super slow request of the stress test:
https://preview.redd.it/w5uaxz062ysa1.png?width=1749&format=png&auto=webp&v=enabled&s=1202a1bb21a99cbaed6f26217da94426b73ca25e
As you can see the time spent on queries is not too bad. If we take a look for example at the 15s endpoint(first one from the silk screenshot) it's pretty simple in princible imo.
class GetOrderItems(APIView):
permission_classes = [OrderItemIsPartOfCompany | WorkerIsPartOfCompany]
@silk_profile(name='Get OrdersItems for Order')
def get(self, request, order_id):
/r/django
https://redd.it/12h0kf1
Ruff: one Python linter to rule them all
https://blog.jerrycodes.com/ruff-the-python-linter/
/r/Python
https://redd.it/12ha6mc
https://blog.jerrycodes.com/ruff-the-python-linter/
/r/Python
https://redd.it/12ha6mc
Jerry Codes
Ruff: one Python linter to rule them all
Ruff, a ridiculously fast Python linter, has been gaining some serious traction recently. No wonder as it's providing close to feature parity with a dozen of linting tools most of which were previously the go-to for the majority of Python projects. Not only…
Microgreens knowledge database: Check Out My Next.js and Django Powered Website 🌱
https://microgreensdb.com
For my new hobby, I decided to create a knowledge database. It took me roughly two days from start to first deploy. I chose to use Next.js because of its static page generation, which allows me to host my backend in one region and scale using the frontend. The metadata was generated using ChatGPT, with seed information from a variety of sources ranging from YouTube to ebooks. At the moment, the seed images are just placeholders. My next goal is to crawl seed prices from different stores and display them.
Please feel free to ask any questions!
/r/django
https://redd.it/12her1o
https://microgreensdb.com
For my new hobby, I decided to create a knowledge database. It took me roughly two days from start to first deploy. I chose to use Next.js because of its static page generation, which allows me to host my backend in one region and scale using the frontend. The metadata was generated using ChatGPT, with seed information from a variety of sources ranging from YouTube to ebooks. At the moment, the seed images are just placeholders. My next goal is to crawl seed prices from different stores and display them.
Please feel free to ask any questions!
/r/django
https://redd.it/12her1o
Microgreensdb
Microgreens knowledge database - microgreensdb
microgreensdb is a knowledge database for microgreens that offers a comprehensive collection of information on growing, cultivation, varieties, uses, and recipes.
How to Integrate Django with React - Free Sample & LIVE Demo in comments
https://blog.appseed.us/how-to-integrate-django-with-react/
/r/django
https://redd.it/12hk2il
https://blog.appseed.us/how-to-integrate-django-with-react/
/r/django
https://redd.it/12hk2il
AppSeed Blog
How to Integrate Django with React (With Sample)
Learn how to integrate Django with React and use the full power from both frameworks - Free sample included.
Anyone using Ruff instead of Pylint in your Django projects?
I am generally very happy with the change from Pylint to Ruff, but unfortunately it doesn't support third party plugins yet, and the lack of "pylint_django" is generating some warnings in my code.
For example, if I have something like:
My editor will highlight
The only workaround I found is to keep pylint running (and keeping my
Has anyone found a less indecent way around this?
/r/django
https://redd.it/12hp83p
I am generally very happy with the change from Pylint to Ruff, but unfortunately it doesn't support third party plugins yet, and the lack of "pylint_django" is generating some warnings in my code.
For example, if I have something like:
MyModel.objects.all() My editor will highlight
MyModel and warn me that Class MyModel has no 'objects' member pylint(no-member)The only workaround I found is to keep pylint running (and keeping my
.pylintrc file on the project's root). Has anyone found a less indecent way around this?
/r/django
https://redd.it/12hp83p
PyPI
ruff
An extremely fast Python linter and code formatter, written in Rust.
I’m a Brazilian salesforce developer and want to work with django stack. Any tips?
/r/django
https://redd.it/12huuq7
/r/django
https://redd.it/12huuq7
Reddit
r/django on Reddit: I’m a Brazilian salesforce developer and want to work with django stack. Any tips?
Posted by u/tiago23x - No votes and no comments
Revitalizing a 5-Year-Old Django Project with DDD - A Journey Worth Sharing!
Hey Reddit,
I recently embarked on a quest to apply Domain-Driven Design (DDD) to my 5-year-old Django project, which, to be honest, wasn't in the best shape. I was met with skepticism and criticism for attempting to integrate DDD with Django. However, I saw this as our last hope to make the project more manageable without having to rewrite it from scratch.
My team and I were determined to find a way to harness the benefits of DDD principles, and eventually, we came up with a set of rules that allowed us to gradually improve the project without halting its growth. I've documented our approach in an article, which I believe could be helpful to others facing similar challenges.
So, if you're interested in learning more about how we breathed new life into our Django project using DDD, or if you have any questions or feedback, I'd love to hear your thoughts in the comments!
https://medium.com/better-programming/saving-django-legacy-project-using-ddd-f1e709795291
/r/django
https://redd.it/12hscxx
Hey Reddit,
I recently embarked on a quest to apply Domain-Driven Design (DDD) to my 5-year-old Django project, which, to be honest, wasn't in the best shape. I was met with skepticism and criticism for attempting to integrate DDD with Django. However, I saw this as our last hope to make the project more manageable without having to rewrite it from scratch.
My team and I were determined to find a way to harness the benefits of DDD principles, and eventually, we came up with a set of rules that allowed us to gradually improve the project without halting its growth. I've documented our approach in an article, which I believe could be helpful to others facing similar challenges.
So, if you're interested in learning more about how we breathed new life into our Django project using DDD, or if you have any questions or feedback, I'd love to hear your thoughts in the comments!
https://medium.com/better-programming/saving-django-legacy-project-using-ddd-f1e709795291
/r/django
https://redd.it/12hscxx
Medium
Saving Django Legacy Projects Using Domain-Driven Design
Steps to take when a project becomes unwieldy, and you are unsure of how to address the issue
v0.5.0 Envio: Securely Manage Your Environment Variables With Encrypted Profiles Using GPG Now!
https://github.com/humblepenguinn/envio
/r/django
https://redd.it/12htusf
https://github.com/humblepenguinn/envio
/r/django
https://redd.it/12htusf
GitHub
GitHub - envio-cli/envio: Envio is a modern and secure command-line tool that simplifies the management of environment variables
Envio is a modern and secure command-line tool that simplifies the management of environment variables - envio-cli/envio
D Simple Questions Thread
Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead!
Thread will stay alive until next one so keep posting after the date in the title.
Thanks to everyone for answering questions in the previous thread!
/r/MachineLearning
https://redd.it/12gls93
Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead!
Thread will stay alive until next one so keep posting after the date in the title.
Thanks to everyone for answering questions in the previous thread!
/r/MachineLearning
https://redd.it/12gls93
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
Tuesday Daily Thread: Advanced questions
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/12i1f6v
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/12i1f6v
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
Free course: Build a modern API with FastAPI and Python
Hello everyone!
I've posted this course 4 months ago on this sub Reddit and it was well received. I want to do another giveaway,
All 3 coupons expire in 4 days and allow for a maximum 1k per coupon redeems.
https://www.udemy.com/course/build-a-movie-tracking-api-with-fastapi-and-python/?couponCode=90707F6B0050F6D60303
https://www.udemy.com/course/build-a-movie-tracking-api-with-fastapi-and-python/?couponCode=F0744D2CC6E3E1C6E622
https://www.udemy.com/course/build-a-movie-tracking-api-with-fastapi-and-python/?couponCode=A620331B2F48333F76D7
I know the course is not top notch and can be improved a lot but honestly I hope you like it as it is. I've set the lowest price I could set for it on Udemy and I'm just grateful that it helped cover my blog hosting fees over the last 3 years.
Thank you!
/r/Python
https://redd.it/12hj9oc
Hello everyone!
I've posted this course 4 months ago on this sub Reddit and it was well received. I want to do another giveaway,
All 3 coupons expire in 4 days and allow for a maximum 1k per coupon redeems.
https://www.udemy.com/course/build-a-movie-tracking-api-with-fastapi-and-python/?couponCode=90707F6B0050F6D60303
https://www.udemy.com/course/build-a-movie-tracking-api-with-fastapi-and-python/?couponCode=F0744D2CC6E3E1C6E622
https://www.udemy.com/course/build-a-movie-tracking-api-with-fastapi-and-python/?couponCode=A620331B2F48333F76D7
I know the course is not top notch and can be improved a lot but honestly I hope you like it as it is. I've set the lowest price I could set for it on Udemy and I'm just grateful that it helped cover my blog hosting fees over the last 3 years.
Thank you!
/r/Python
https://redd.it/12hj9oc
Udemy
Build a Modern API with FastAPI and Python
Design a REST API with Fast API, write unit-tests, use MongoDB. Learn containerization, middleware, scaling & auth.
What does a beginning Django developer need before applying for a job?
Do employers expect a couple of completed projects?
/r/django
https://redd.it/12i8dtf
Do employers expect a couple of completed projects?
/r/django
https://redd.it/12i8dtf
Reddit
r/django on Reddit: What does a beginning Django developer need before applying for a job?
Posted by u/stopscrollingrall - No votes and no comments
Python Library for Astronomy
Check out my new python library for astronomy! It is aimed at providing information on the position of the sun, planets, and more. It can also deal with time, and convert between julian dates and gregorian dates (sidereal time is also calculated). View its source code at https://github.com/PyndyalaCoder/astronomica and the official project page at https://pypi.org/project/astronomica/. Please upvote! It really motivates me to make more projects. Also, don't forget to share with others! Comment below and tell me what you think! If you have any edits, bug fixes or general updates in mind, please create a fork on github and then a pull request. Thank you! If you have the time, also check out the github page and star it please! Have a great afternoon and happy programming!
/r/Python
https://redd.it/12hrxcw
Check out my new python library for astronomy! It is aimed at providing information on the position of the sun, planets, and more. It can also deal with time, and convert between julian dates and gregorian dates (sidereal time is also calculated). View its source code at https://github.com/PyndyalaCoder/astronomica and the official project page at https://pypi.org/project/astronomica/. Please upvote! It really motivates me to make more projects. Also, don't forget to share with others! Comment below and tell me what you think! If you have any edits, bug fixes or general updates in mind, please create a fork on github and then a pull request. Thank you! If you have the time, also check out the github page and star it please! Have a great afternoon and happy programming!
/r/Python
https://redd.it/12hrxcw
GitHub
GitHub - PyndyalaCoder/astronomica
Contribute to PyndyalaCoder/astronomica development by creating an account on GitHub.
Help deploying my first project to production.
Hello,
I have a little experience with Django and Ive recently just finished developing my first solo django project. Its an art website for my dad’s paintings that features a home page, gallery, and contact page. I would like to host this website online but I’m not sure of the process to go about getting the project ready for production and deploying it. Ive found plenty online but id really appreciate if any experienced django developer could help me with the process.
/r/django
https://redd.it/12hr76g
Hello,
I have a little experience with Django and Ive recently just finished developing my first solo django project. Its an art website for my dad’s paintings that features a home page, gallery, and contact page. I would like to host this website online but I’m not sure of the process to go about getting the project ready for production and deploying it. Ive found plenty online but id really appreciate if any experienced django developer could help me with the process.
/r/django
https://redd.it/12hr76g
Reddit
r/django on Reddit: Help deploying my first project to production.
Posted by u/ejm55 - 5 votes and 7 comments
Desktop Application
Hello Guys , I Hope You're Doing Well
So i've created this Desktop App Using python , it scraps post titles and post contents from the "techCrunch" Sites ,
its useful for tech content Creators , instead of checking The Site daily all you have is to open the app then select a category " the home page is the default one "
i want you to tell me what do you think about it , how would i improve it ( design , other functions .. etc )
and if you want to try it i'll send you the download link
​
https://reddit.com/link/12ib99c/video/p9fzt6gma7ta1/player
/r/Python
https://redd.it/12ib99c
Hello Guys , I Hope You're Doing Well
So i've created this Desktop App Using python , it scraps post titles and post contents from the "techCrunch" Sites ,
its useful for tech content Creators , instead of checking The Site daily all you have is to open the app then select a category " the home page is the default one "
i want you to tell me what do you think about it , how would i improve it ( design , other functions .. etc )
and if you want to try it i'll send you the download link
​
https://reddit.com/link/12ib99c/video/p9fzt6gma7ta1/player
/r/Python
https://redd.it/12ib99c
Reddit
r/Python on Reddit: Desktop Application
Posted by u/Mr_N_01 - No votes and 8 comments
Flask-SQLAlchemy, how to render supposedly easy query
Hi all,
I'm using SQLAlchemy in flask using flask-sqlalchemy as mostly suggested around the web but i'm facing some issues on basic queries (maybe it's something wrong on the model).
I have this model:
class Event(db.Model):
id = db.Column(db.Integer, primarykey=True)
timestamp = db.Column(db.DateTime(timezone=True),default=datetime.now(),serverdefault=func.now())
date = db.Column(db.Date(),default=datetime.now(),serverdefault=func.now())
environmentid = db.Column(db.Integer, db.ForeignKey('environment.id'))
sourceid = db.Column(db.Integer, db.ForeignKey('source.id'))
releaseid = db.Column(db.Integer, db.ForeignKey('release.id'))
event = db.Column(db.String(200))
def repr(self) -> str:
return '<Event {}:{}>'.format(self.id, self.event)
First issue is that I supposed that "date" field, using (db.Date()) column, would be a date without a time (e.g.: 2023-04-11) while in my database (sqlite3 in my desktop, shall be mysql once put into "production") is still a timestamp (e.g.: 2023-04-11 09:05:13). I Suppose that on mysql this would be rendered correctly?
Second issue, tied to
/r/flask
https://redd.it/12ibss4
Hi all,
I'm using SQLAlchemy in flask using flask-sqlalchemy as mostly suggested around the web but i'm facing some issues on basic queries (maybe it's something wrong on the model).
I have this model:
class Event(db.Model):
id = db.Column(db.Integer, primarykey=True)
timestamp = db.Column(db.DateTime(timezone=True),default=datetime.now(),serverdefault=func.now())
date = db.Column(db.Date(),default=datetime.now(),serverdefault=func.now())
environmentid = db.Column(db.Integer, db.ForeignKey('environment.id'))
sourceid = db.Column(db.Integer, db.ForeignKey('source.id'))
releaseid = db.Column(db.Integer, db.ForeignKey('release.id'))
event = db.Column(db.String(200))
def repr(self) -> str:
return '<Event {}:{}>'.format(self.id, self.event)
First issue is that I supposed that "date" field, using (db.Date()) column, would be a date without a time (e.g.: 2023-04-11) while in my database (sqlite3 in my desktop, shall be mysql once put into "production") is still a timestamp (e.g.: 2023-04-11 09:05:13). I Suppose that on mysql this would be rendered correctly?
Second issue, tied to
/r/flask
https://redd.it/12ibss4