프로젝트/Django project
[웹 프로젝트] Django User 분류
choco-songyi
2020. 10. 27. 14:45
유저의 종류가 다양한데, 어떤 것을 사용해야 할지 고민이 되어서 찾아보았다!
- abstractUser는 장고의 내장 인증 기능을 이용하되, 특정 속성을 추가하고 싶을 때 사용한다!
Conclusions
Alright! We’ve gone through four different ways to extend the existing User Model. I tried to give you as much details as possible. As I said before, there is no best solution. It will really depend on what you need to achieve. Keep it simple and choose wisely.
- Proxy Model: You are happy with everything Django User provide and don’t need to store extra information.
- User Profile: You are happy with the way Django handles the auth and need to add some non-auth related attributes to the User.
- Custom User Model from AbstractBaseUser: The way Django handles auth doesn’t fit your project.
- Custom User Model from AbstractUser: The way Django handles auth is a perfect fit for your project but still you want to add extra attributes without having to create a separate Model.
simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html
How to Extend Django User Model
The Django’s built-in authentication system is great. For the most part we can use it out-of-the-box, saving a lot ofdevelopment and testing effort. It fits ...
simpleisbetterthancomplex.com