How do you add days to the current DateField?

A Django DateField is represented in Python as a datetime.date object. Therefore, to add more days (i.e 100 days) to the field retrieved from the database you can do something as below:

import datetime
current_date = datetime.date(2022, 1, 20)
current_date + datetime.timedelta(days=100)

In this example, I created a datetime object (instead of retrieving it from the database) and I added 100 days to it. The result is again a datetime object datetime.date(2022, 4, 30).

If you like the content here please consider subscribing.

I will create a video of this guide as well in the future. If you want to get notified when the video tutorial is ready subscribe.

If you have any comments or feedback feel free to reach me @costapiy