I need to implement some REST api for a mobile application.
I would like to use the Django REST framework.
The user (mobile side) can register an account only using Facebook, I would use python-social-auth for this registration / login.
I am new to this, so I have seen many tutorials / documents / examples about this.
I only found a complete tutorial about Django + python_social_auth, but I would know exactly how best to do user registration / login using REST-api.
Where can I find a complete example?
In my simple test, I also have a problem: When I try to use this example:
@psa('social:complete') def register_by_access_token(request, backend): # This view expects an access_token GET parameter, if it needed, # request.backend and request.strategy will be loaded with the current # backend and strategy. token = request.GET.get('access_token') user = request.backend.do_auth(request.GET.get('access_token')) if user: login(request, user) return 'OK' else: return 'ERROR'
I get this error:
u'social 'is not a registered namespace
I also tried adding this SOCIAL_AUTH_URL_NAMESPACE = 'myApp' to my settings, but this did not solve the problem.
python rest django django-rest-framework python-social-auth
Safari
source share