2
저는 개인 정보를 데이터베이스에 저장하는 것을 피하고 싶습니다. 개인 정보를 익명화하는 소셜 네트워크 인증 서비스 (python-social-auth 덕분에) python-social-auth 및 django 사용자로 가장
- 위임 인증이 그것을 달성하기 위해 내 접근 방식입니다.
social_details
단계를 대체 :
#myapp/mypipeline.py
def social_details(strategy, response, *args, **kwargs):
import md5
details = strategy.backend.get_user_details(response)
email = details['email']
fakemail = unicode(md5.new(email).hexdigest())
new_details = {
'username': fakemail[:5],
'email': fakemail + '@noreply.com',
'fullname': fakemail[:5],
'first_name': details['first_name'],
'last_name': '' }
return {'details': new_details }
settings.py
질문SOCIAL_AUTH_PIPELINE = (
'myapp.mypipeline.social_details',
'social.pipeline.social_auth.social_uid',
...
:
얻을이 올바른 방법인가 내 목적?
접근법이 좋으며 응용 프로그램에서 파이프 라인의 목적에 맞습니다. – omab
@omab, 답장을 보내 주셔서 감사 드리며 위대한 [python-social-auth] (https://github.com/omab/python-social-auth) 소프트웨어에 대해서도 감사드립니다. 해결책으로 확인하기 위해 답글로 의견을 게시 하시겠습니까? – danihp