Answers for "how to logout user in django custom user model"

1

django logout user

def logout_request(request):
      logout(request)
      return redirect("")
Posted by: Guest on August-20-2020
0

Django Custom User Model

./manage.py shell
>>>
>>> from django.contrib.admin.models import LogEntry
>>> from django.contrib.contenttypes.models import ContentType
>>>
>>> auth_user = ContentType.objects.get(app_label='auth', model='user')
>>> accouts_user = ContentType.objects.get(app_label='Accounts', model='user')
>>>
>>> for le in LogEntry.objects.filter(content_type=auth_user):
...     le.content_type = accouts_user
...     le.save()
...
Posted by: Guest on May-30-2021

Code answers related to "how to logout user in django custom user model"

Python Answers by Framework

Browse Popular Code Answers by Language