Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
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
Django smtp error

/r/djangolearning
https://redd.it/12h6g5y
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:

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
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
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
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
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
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
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
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
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
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())
environment
id = db.Column(db.Integer, db.ForeignKey('environment.id'))
sourceid = db.Column(db.Integer, db.ForeignKey('source.id'))
release
id = 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
Best practise with django migrations in google cloud run.

Hi folks,

I've got a containerised django app in google cloud run. I've began the process of automating its release using github actions and all is going smoothly, but i've hit a bit of an issue that im not sure on the best practise on. When handling migrations, what would be the best way to do this?

I feel like the way to go is to, once i've deployed the new instance to cloud run, to get the CD pipeline to run `./manage.py migrate`, but i can't find much documentation on whether this is okay. I could also add this to the dockerfile, but i dont really want to be trying to migrate every time google spins up a new instance.

Note that im using a database hosted outside of google due to extensions required that google SQL Cloud doesn't support.

/r/django
https://redd.it/12ibxnq
I was working in password reset email by watching some tutorial and I want some help as I entered the email in the form but it doesnt provide me with recovery email

&#x200B;

https://preview.redd.it/bfgaqyiga8ta1.png?width=1316&format=png&auto=webp&v=enabled&s=97128f5ca6c20b343079b0fe4b88c128346b367f

/r/django
https://redd.it/12ievsv
Track user interactions

I am writing a django app that has staff and client users, I want to be able to track various actions like "Client X filled out Y form" or "Staff X exported Y document" in a live updated feed on my management page. Is there a django package for something like this? If not I'll make it myself - I'm thinking of using HTMX polling.

/r/django
https://redd.it/12iib3c