django admin, show user id code example
Example 1: how to get user id django
def sample_view(request):
current_user = request.user
print current_user.id
Example 2: django check user admin
user.is_superuser
def sample_view(request):
current_user = request.user
print current_user.id
user.is_superuser