vishalanandl177 / DRF-API-Logger

An API Logger for your Django Rest Framework project.
https://github.com/vishalanandl177/DRF-API-Logger
Apache License 2.0
308 stars 56 forks source link

ValueError at /admin/drf_api_logger/apilogsmodel/ Database returned an invalid datetime value. Are time zone definitions for your database installed? Request Method: #100

Open PradheepManimaran opened 2 months ago

PradheepManimaran commented 2 months ago

I have used in the settings.py Timezone asia india timezone but its throws error but i used UTC Time It works well how to fix the issue Screenshot from 2024-08-09 21-50-52

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Asia/Kolkata'

USE_TZ = True

GET Request URL: http://127.0.0.1:8000/admin/drf_api_logger/apilogsmodel/ ValueError at /admin/drf_api_logger/apilogsmodel/ Database returned an invalid datetime value. Are time zone definitions for your database installed? Request Method:

FG-Samuli commented 1 month ago

I faced this same problem. My MySQL database is installed on host and everything is saved in UTC. Django project is running on docker container. If TZ is set in settings file to UTC, everything works OK. TIME_ZONE = 'Europe/Helsinki'

If I change it to 'Helsinki' the error is: ValueError: Database returned an invalid datetime value. Are time zone definitions for your database installed? "GET /admin/drf_api_logger/apilogsmodel/ HTTP/1.1" 500 1172