Posts

Showing posts with the label django-rest-framework

Social login flow with Django backend and ionic frontend

Image
Clash Royale CLAN TAG #URR8PPP Social login flow with Django backend and ionic frontend I am trying to integrate social login with my ionic app, which is consuming data from a DRF server. The idea is that an user can login through fb, do some magic, the data will be sent back to the django server, and next time they log in they can retrieve their personal data again. So far I'm using native Cordova Fb plugin on ionic and I have managed to successfully log in with it. The problem now is I'm lost on what to do in the next step or the flow of the entire process. How do I register an user from Facebook to my django server so that the next time the user login I can retrieve the data from that respective user correctly? Let's say after I login with FB, I got an access token, do I pass that token back to django to register the new user and if so what tool should I use? For authentication I plan to have Django passing JWT back to the ionic app, but the part in the middle is where I...

Relative import beyond top-level package Error

Image
Clash Royale CLAN TAG #URR8PPP Relative import beyond top-level package Error I have a project named tweetme which has two apps account and tweets ,i have serializers.py file in both of the apps to serialize data. So when i try to relative import the serializer class from account/api/serializers.py to another app tweets/api/serializers.py , the relative import shows error. tweetme account tweets serializers.py account/api/serializers.py tweets/api/serializers.py 1- 1st i tried full path from src.account.api.serializers import UserDisplaySerializer , it gave error in console that ModuleNotFoundError: No module named 'src' from src.account.api.serializers import UserDisplaySerializer ModuleNotFoundError: No module named 'src' 2- Then i tried from ...account.api.serializers import UserDisplaySerializer ,its showing error ValueError: attempted relative import beyond top-level package . from ...account.api.serializers import UserDisplaySerializer ValueError: attempted re...