User Sign Up view using DRF

85 views
Skip to first unread message

Ankit Agrawal

unread,
Aug 15, 2015, 2:56:51 AM8/15/15
to Django REST framework
Hi everyone,

     I am new to Django and DRF and using it in a project with Token based Authentication where clients are going to be on Android, iOS apps. So the user would first register/sign-up on the app and then subsequently I would be using tokens to authenticate a registered user. What I am clueless about is what is the best way to make a user registration view. The most obvious way that comes to my mind is to use @csrf_exempt decorator for a register view. Any better ways to do this? Thanks.

Tom Christie

unread,
Aug 15, 2015, 4:03:14 AM8/15/15
to Django REST framework
The djoser project will probably save you some work here:

https://github.com/sunscrapers/djoser

Ankit Agrawal

unread,
Aug 17, 2015, 3:51:06 AM8/17/15
to django-res...@googlegroups.com
Hi Tom,

      At least for now, I would prefer not using Djoser because of the flexibility and customization I want and hence would want to make custom views. I was not very clear in my previous post but my question is this -

For non-browser clients like Android apps, where I am using tokens for authenticating the requests, how do I handle/authenticate the initial registration POST request? I can use @csrf_exempt decorator in my custom register view that will handle the initial user registration and generate the token but then someone can bypass by writing a script that can register many fake users in an automated fashion.
 Is there a better/secure way to do this without using Djoser?


Ankit Agrawal,
IIT Bombay.

On Sat, Aug 15, 2015 at 1:33 PM, Tom Christie <christ...@gmail.com> wrote:
The djoser project will probably save you some work here:

https://github.com/sunscrapers/djoser

--
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/zNNtoWrvXBU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages