DJANGO-ALLAUTH社交用户系统的安装配置
DJANGO-ALLAUTH是github上面排名较高的djangouser系统.本来通过对比是想选用django-userea的,可是博主智商不够看懂它的安装配置文档.....搞乱了一个测试项目之后,只好作罢.好在allauth安装配置相对简单.但是它的文档写得更乱...很多关键信息居然是在常见问题里面找到...记录下来备忘.
1.安装:
pipinstalldjango-allauth
2.配置
settings.py
TEMPLATE_CONTEXT_PROCESSORS=( "django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.static", "django.core.context_processors.tz", #"django.contrib.messages.context_processors.messages" #Requiredbyallauthtemplatetags "django.core.context_processors.request", #allauthspecificcontextprocessors "allauth.account.context_processors.account", "allauth.socialaccount.context_processors.socialaccount", )
AUTHENTICATION_BACKENDS=( #NeededtologinbyusernameinDjangoadmin,regardlessof`allauth` "django.contrib.auth.backends.ModelBackend",
#`allauth`specificauthenticationmethods,suchasloginbye-mail "allauth.account.auth_backends.AuthenticationBackend", )
INSTALLED_APPS=( ... #TheDjangositesframeworkisrequired 'django.contrib.sites',
'allauth', 'allauth.account', 'allauth.socialaccount', #...includetheprovidersyouwanttoenable: 'allauth.socialaccount.providers.amazon', 'allauth.socialaccount.providers.angellist', 'allauth.socialaccount.providers.bitbucket', 'allauth.socialaccount.providers.bitly', 'allauth.socialaccount.providers.coinbase', 'allauth.socialaccount.providers.dropbox', 'allauth.socialaccount.providers.facebook', 'allauth.socialaccount.providers.flickr', 'allauth.socialaccount.providers.feedly', 'allauth.socialaccount.providers.github', 'allauth.socialaccount.providers.google', 'allauth.socialaccount.providers.hubic', 'allauth.socialaccount.providers.instagram', 'allauth.socialaccount.providers.linkedin', 'allauth.socialaccount.providers.linkedin_oauth2', 'allauth.socialaccount.providers.openid', 'allauth.socialaccount.providers.persona', 'allauth.socialaccount.providers.soundcloud', 'allauth.socialaccount.providers.stackexchange', 'allauth.socialaccount.providers.tumblr', 'allauth.socialaccount.providers.twitch', 'allauth.socialaccount.providers.twitter', 'allauth.socialaccount.providers.vimeo', 'allauth.socialaccount.providers.vk', 'allauth.socialaccount.providers.weibo', 'allauth.socialaccount.providers.xing', ... )