Codes/Python

Django How to delete superuser

2020. 8. 13. 15:34

구서울역

 

Create Django Superuser

$ python manage.py createsuperuser

 

Delete Django Superuser

(venv) $ python manage.py shell
Python 3.7.6 (default, Jan  8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth import get_user_model
>>>
>>> User = get_user_model()
>>> User.objects.get(username='stealien').delete()
(1, {'User.User': 1})
>>>