Using extra_data from python-social-auth in Django template -
i using python-social-auth log in own web application linkedin. logged in , redirect home page. next step utilize data (i.e. usersocialauth.extra_data). give example how access data in either django templates or django views?
this settings had.
social_auth_login_url = '' social_auth_pipeline = ( 'social.pipeline.social_auth.social_details', 'social.pipeline.social_auth.social_uid', 'social.pipeline.social_auth.auth_allowed', 'social.pipeline.social_auth.social_user', 'social.pipeline.user.get_username', 'social.pipeline.user.create_user', 'social.pipeline.social_auth.associate_user', 'social.pipeline.social_auth.load_extra_data', 'social.pipeline.user.user_details' ) social_auth_linkedin_oauth2_scope = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'] social_auth_linkedin_oauth2_field_selectors = ['first-name', 'last-name', 'email-address', 'headline'] social_auth_linkedin_oauth2_extra_data = [('id', 'id'), ('first-name', 'first_name'), ('last-name', 'last_name'), ('email-address', 'email_address'), ('headline', 'headline'), ('industry', 'industry')]
what going like:
<html><body>here go! {{ user.first_name }} {{ user.last_name }} {{ user.email }} {{ user.extra_data.headline }}</body></html>
any comments highly appreciated!
Comments
Post a Comment