J
J
Jekson2019-05-31 14:58:24
Django
Jekson, 2019-05-31 14:58:24

How to add a user from a custom registration system in Django?

There is a custom user registration system that is not tied to django.contrib.auth.
The user model is on models.Model but does not inherit AbstractUser and BaseUserManage, the logic is all self-written (not by me). How can I now access an authorized user from request to perform standard CRUD operations and differentiate access rights to content?
That is, wherever request.user is usually used, now you need to use something else, I have never encountered this. Does anyone have experience to share?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-05-31
@Lepilov

If there is no way to "rewrite humanly" and you are sure that there is "not humanly", then there are three options:
By the way, as a matter of fact for item 1 the same "function" is necessary. It's just that the calling methods are different.
But of course it's better to rewrite it in a normal way. Although business does not always need it (due to 1-2 minor edits, rewrite legacy code).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question