Search code examples
djangodjango-rest-frameworkdjango-allauthdjango-rest-auth

How to test registration on django rest framework


I'm new to django rest framework.
I'm following this tutorial to make a registration/login and using facebook authentication.
I finish the tutorial everything looks fine. But I would like to try to register a user and try it also with facebook. But I don't know how to try. I know it's a noob question.
I've made a user using the django createsuperuser command. I can login using the http://localhost:8000/rest-auth/login/ url and it return me a key. But I'm logged in and can access the admin for example.
There is http://localhost:8000/rest-auth/registration/ url for registration but there is no form.
There is also http://localhost:8000/rest-auth/facebook/ but it ask me an access token.

So I know it's sound very basic but I didn't find how to register


Solution

  • You need to use CURL to interact with the API. Something like this

    $ curl -X POST -d 'username=admin&password=1234' http://localhost:8000/register/

    OR go through this link it might help you.