[Django]-Why am I getting this Django custom command error: 'datetime.timezone' has no attribute 'now'

2👍

Change imports to this:

from django.utils import timezone
from datetime import timedelta

And it will work better. Django also uses datetime.

2👍

from django.utils import timezone

You need to import it like this, this is the doc

👤svfat

Leave a comment