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})
>>>
'Codes > Python' 카테고리의 다른 글
Search by function returns in Django Admin (0) | 2021.07.27 |
---|---|
Add middleware which loads JSON body in Django Python (0) | 2020.09.09 |
Django Parsing Json in Function based view (0) | 2020.08.13 |
Django Customizing Default User Model (0) | 2020.08.12 |
Python3 requests에서 r.text와 r.content의 차이 (0) | 2020.07.21 |