jazzband / django-rest-knox

Authentication Module for django rest auth
MIT License
1.1k stars 206 forks source link

Unable to read timezone specified in settings.py #351

Closed Virendra69 closed 1 month ago

Virendra69 commented 1 month ago

I had set the timezone in settings.py as "Aisa/Kolkata" and when I logged in using Knox's LoginView, I checked the database to see the date value in created field and to my surprise it didn't match with the one on my system.

johnraz commented 1 month ago

Hello and thanks for reaching out !

We are relying on Django DateTimeField with auto_add_now=True as you can see here -> https://github.com/jazzband/django-rest-knox/blob/develop/knox/models.py#L45

I very much doubt that there is an issue with timezone management on that side of Django.

I guess your database is storing the date in UTC or something like that and this is what is confusing you.

This is most definitely not an issue with Knox itself so I will go ahead and close this issue.

If you happen to find and can provide evidence that the problem originates from knox, pease re-open.