The datetime and django.utils.timezone modules are available, so you can do e.g. timezone.now

Import the necessary module:

from django.utils import timezone

Use the timezone.now() method to obtain the current datetime in the timezone of the settings:

current_datetime = timezone.now()