0
votes

I am receiving this error message:

RuntimeWarning: DateTimeField Z.data_zal received a naive datetime (2020-11-05 07:13:24) while time zone support is active. warnings.warn("DateTimeField %s received a naive datetime (%s)"

At this step of creating my models instance: views.py

 from django.utils import timezone

 t = Z(data_z=timezone.now().strftime('%Y-%m-%d %H:%M:%S'), data_r=data_r, author=request.user)
 try:
     t.save()

So as far as I know this error occurs when using datetime module instead of timezone. Sometimes the problem lies in wrong settings.py but I am running:

TIME_ZONE = 'Europe/Warsaw'

USE_TZ = True

What seems to be the issue?

1

1 Answers