python - Django : How to access current logged in user's id in javascript? - Stack Overflow

PHOTO EMBED

Wed May 25 2022 00:38:41 GMT+0000 (UTC)

Saved by @musikito #js #djan

{{ request.user.id|json_script:"user_id" }}
content_copyCOPY

how to send the current user to JS from Django

https://stackoverflow.com/questions/34719230/django-how-to-access-current-logged-in-users-id-in-javascript