Custom user model

43 views
Skip to first unread message

Ashutosh Mishra

unread,
Sep 8, 2020, 3:21:22 AM9/8/20
to Django REST framework
i want to create authentication of student,admin and superadmin using viewset and routers without serializers(custom code) how can i do this,some please guide me

Carl Nobile

unread,
Sep 8, 2020, 12:26:07 PM9/8/20
to django-res...@googlegroups.com
If you don't want to write ANY custom code then you probably cannot do it. I've never written any site without at least some custom code.
At a minimum, you will probably need some custom permission classes that you would set on the views--this keeps people with different roles out of stuff they shouldn't be in.
You need to use some sort of token system either OAuth2 (better--more flexible) or the one built into DRF for communication between the frontend and backend. This is usually non-trivial.

Think about what you are asking and you will see it takes work and customization is always part of it.

~Carl

On Tue, Sep 8, 2020 at 3:21 AM Ashutosh Mishra <ashutosh...@gmail.com> wrote:
i want to create authentication of student,admin and superadmin using viewset and routers without serializers(custom code) how can i do this,some please guide me

--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/a9c47573-7ae1-4a3e-b1a2-181fb3cee08dn%40googlegroups.com.


--
-------------------------------------------------------------------------------
Carl J. Nobile (Software Engineer)
carl....@gmail.com
-------------------------------------------------------------------------------

Ashutosh Mishra

unread,
Sep 8, 2020, 12:33:28 PM9/8/20
to django-res...@googlegroups.com
My bad,means using custom code,,not by serializer

You received this message because you are subscribed to a topic in the Google Groups "Django REST framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-rest-framework/RAsaI4kquNc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-rest-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQLTFyyvB6LK3OyY1OnTuTvhoe64sLL2eRwoeyTPfuaExg%40mail.gmail.com.

Carl Nobile

unread,
Sep 8, 2020, 12:41:39 PM9/8/20
to django-res...@googlegroups.com
The serializers are what I customize the most. You will need to write field validation methods along with custom create and update methods. If you have embedded serializer there is no way around this. DRF provides you a framework, not a finished product.
Depending on the size of the web service you are building any project like this is between three and ten months. I just left one at Cisco that was three years and it's still being worked on. Building for the web is time-consuming there are NO short cuts. An make sure you write tests on your code WILL be broken.

~Carl

Carl Nobile

unread,
Sep 8, 2020, 12:44:44 PM9/8/20
to django-res...@googlegroups.com
Here's an open-source project I've been working on so you can see what I'm talking about. BTW--I don't use viewsets nor routers in my code.
Be sure you are looking in the develop branch, master is very old.

~Carl

Ashutosh Mishra

unread,
Sep 8, 2020, 12:45:26 PM9/8/20
to django-res...@googlegroups.com
Thanks for your priceless information
But my task is to by custom code,i M not looking for shortcut,ready to learn and and implement.

Carl Nobile

unread,
Sep 8, 2020, 12:48:13 PM9/8/20
to django-res...@googlegroups.com
The best way to learn is to look at what other people have done, that's why I gave you the link to a Django/DRF project I've been working on.

Reply all
Reply to author
Forward
0 new messages