Python Flask Tutorial #6 - User Authentication

· 6년 전 · 770

https://youtu.be/CSHx6eCkmv0?list=PL-osiE80TeTs4UjLw5MM6OjgkjFeUxCYH

 

그누는 pbkdf2 https://pypi.org/project/pbkdf2/ 를 사용하죠..

 

여기는 bcrypt를 사용합니다. 

 

https://flask-bcrypt.readthedocs.io/en/latest/

 

```

pipenv install flask-bcrypt

```

 

bcrypt는 같은 패스워드라도 나오는 해시값이 매번 다르네요.

 

화면에 에러가 났을 때,  처음 실행시에 나오는 Debugger pin을  입력하면, 브라우저에서 바로 python z코드를 실행시겨 볼수가 있네요..  (13분근처)

 

세션을 관리해주는 모듈이 flask-login입니다.  login_user, current_user, logout_user

https://flask-login.readthedocs.io/en/latest/

```

pipenv install flask-login

```

 

http://localhost:5000/login?next=%2Faccount

와 같은 next parameter를 처리해줌. (44분경)

 

next_page = request.args.get('next')

 

새로운 if 문입니다.  파이썬에서 만 있나요?

 

return redirect(next_page) if next_page else redirect(url_for('home'))

 

 

 

 

|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

파이썬 게시판 만들기

+
제목 글쓴이 날짜 조회
6년 전 조회 1,358
6년 전 조회 1,298
6년 전 조회 979
6년 전 조회 1,114
6년 전 조회 980
6년 전 조회 1,321
6년 전 조회 1,265
6년 전 조회 904
6년 전 조회 704
6년 전 조회 982
6년 전 조회 1,610
6년 전 조회 1,084
6년 전 조회 813
6년 전 조회 1,155
6년 전 조회 771
6년 전 조회 993
6년 전 조회 1,196
6년 전 조회 1,016
6년 전 조회 1,400
6년 전 조회 1,070
6년 전 조회 970
6년 전 조회 939
6년 전 조회 2,292
6년 전 조회 854
6년 전 조회 2,361
6년 전 조회 848
6년 전 조회 964
6년 전 조회 1,003
6년 전 조회 1,224
6년 전 조회 919
🐛 버그신고