Question

I'm pretty new to django and I'm a little confused as to what is the best and common practice for implementing users in Django apps. Do people

  1. use the django's built-in user system in each app,
  2. create an app using django's built-in users and applying that to other apps,
  3. use a third-party app like Pinax, or something else entirely?

Thanks for the help.

Was it helpful?

Solution

Unfortunately, "BEST" is very subjective. Django provides many flexible ways for you to model users (and customize users) so that you can leverage their built in authentication and user system.

  1. Will django's built in user system provide you with everything you need for your requirments? If so then use it, If you just need to add a couple more fields, create a new model and give it a onetoone with the built in user object
  2. Not so much, django provides a new AbstractBaseUser that should be flexible enough to do whatever you need to do regarding users, I have not used it personally yet, but documentation on it can be found https://docs.djangoproject.com/en/dev/topics/auth/customizing/
  3. Does a third party app provide you with your desired functionality out of the box, or with minimal configuration? Probably

Basically, it all depends on your requirements! Django's built in user should be more then sufficient for the majority of websites

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top