[Answered ]-Where to write code to extend django user table and capture the user authentication details

1👍

1) Create an app, accounts for example, and put your users profiles models (or create custom User model) in models.py file

2) You must check the user permissions in the views.py.
If you use function views you can create decorators with your checks as described here.
Also take a look at existing decorators.
If you use class based views you can create decorators or create mixins, described here. There is apps that allready have some mixins, for example django-braces

1👍

There are two way to do this, according to Django docs. Extend existing User:

If you wish to store information related to User, you can use a
one-to-one relationship to a model containing the fields for
additional information. This one-to-one model is often called a
profile model, as it might store non-auth related information about a
site user. For example you might create an Employee model:

And Substituting a custom User model¶

Some kinds of projects may have authentication requirements for which
Django’s built-in User model is not always appropriate. For instance,
on some sites it makes more sense to use an email address as your
identification token instead of a username.

There are examples for both approaches in docs.

Leave a comment