How to get the currently logged-in user\'s id?
in models.py:
models.py
class Game(models.model): name = models.CharField(max_length=255) o
FOR WITHIN TEMPLATES
This is how I usually get current logged in user and their id in my templates.
Your Username is : {{user}} Your User Id is : {{user.id}}
Your Username is : {{user}}
Your User Id is : {{user.id}}