0

I'm writing a web app using the django framework and I was just wondering what are the pros/cons of using the built-in django.contrib.auth.models.User model over my own user model? Please explain in terms of performance, scalability and security.

Many thanks

StarCub
  • 4,141
  • 7
  • 41
  • 58
  • See http://stackoverflow.com/questions/44109/extending-the-user-model-with-custom-fields-in-django – sunn0 Oct 22 '10 at 22:41
  • thanks, but the question was about how to extend the built-in User model. What I'm asking is whether I should use the built-in User model or create my own. – StarCub Oct 22 '10 at 23:07
  • Isn't that exactly the answer? Do not extend the User model ... create a Foreign Key to your own Extended User Info model instead (Profile). If you still want to extend the User model there are links on how to do it in the question linked above as well. – sunn0 Oct 23 '10 at 14:45

2 Answers2

2

I always use the contrib.auth.models.User model, as many other apps also use it. Even if you want to have differences, it usually ends up being simpler to extend using a UserProfile than to try to build your own.

Matthew Schinckel
  • 35,041
  • 6
  • 86
  • 121
1

Unless you need to integrate with an auth backend that doesn't reasonably fit with contrib.auth, there aren't really any reasons to roll your own authentication app. auth provides its own access control models, but if they don't match your needs you don't need to use them. it provides a number of auth backends but if none of them are quite an exact match, then you can write your own backend and still use the rest of contrib.auth

SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304