왜? db를 확인하고 싶어서 localhost:8080/admin으로 접속했는데 계정 정보를 모름!
1. django shell에 들어가서 계정 정보를 확인한다.
(venv) C:\Users\user\PycharmProjects\DjangoProject\insta>python manage.py shell
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth.models import User
>>> superusers = User.objects.filter(is_superuser=True)
>>> superusers
<QuerySet [<User: kho903>]>
>>>
2. 패스워드를 바꾸어준다.
- 너무 쉬우면 계속 다시 하라고 함.
(venv) C:\Users\user\PycharmProjects\DjangoProject\insta>python manage.py changepassword kho903
Changing password for user 'kho903'
Password:
Password (again):
This password is too short. It must contain at least 8 characters.
This password is too common.
This password is entirely numeric.
Password:
Password (again):
Password changed successfully for user 'kho903'
3. localhost:8000/admin/auth/user에서 확인해보기
- /admin 에서 로그인
- test로 회원가입한 user 두 명이 있는 것을 확인할 수 있음.
*** 새로 superuser 계정을 만들어줄 수도 있음.
(venv) C:\Users\user\PycharmProjects\DjangoProject\insta>python manage.py createsuperuser
Username (leave blank to use 'user'): mink
Email address:
Password:
Password (again):
This password is too short. It must contain at least 8 characters.
This password is entirely numeric.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.
'프로젝트 > Django project' 카테고리의 다른 글
[웹 프로젝트] Django authentication을 이용한 로그인 및 회원가입 (0) | 2020.10.26 |
---|---|
[웹 프로젝트] Django Git merge (DB 오류) (0) | 2020.10.26 |
[웹 프로젝트] Django 앱을 실행하기 위한 과정 (0) | 2020.10.23 |
[웹 프로젝트] Django runserver 오류 - Unicode decode Error (0) | 2020.10.23 |
[웹 프로젝트] Django URL설정하기 (0) | 2020.10.23 |
WRITTEN BY
,