我试图将Django社交身份验证用于Google身份验证,但出现以下错误,

No module named auth.urls

settings.py

AUTHENTICATION_BACKENDS = (
    'social_auth.backends.twitter.TwitterBackend',
    'social_auth.backends.facebook.FacebookBackend',
    'social_auth.backends.google.GoogleOAuthBackend',
    'social_auth.backends.google.GoogleOAuth2Backend',
    'social_auth.backends.google.GoogleBackend',
    'social_auth.backends.yahoo.YahooBackend',
    'social_auth.backends.browserid.BrowserIDBackend',
    'social_auth.backends.contrib.linkedin.LinkedinBackend',
    'social_auth.backends.contrib.disqus.DisqusBackend',
    'social_auth.backends.contrib.livejournal.LiveJournalBackend',
    'social_auth.backends.contrib.orkut.OrkutBackend',
    'social_auth.backends.contrib.foursquare.FoursquareBackend',
    'social_auth.backends.contrib.github.GithubBackend',
    'social_auth.backends.contrib.vk.VKOAuth2Backend',
    'social_auth.backends.contrib.live.LiveBackend',
    'social_auth.backends.contrib.skyrock.SkyrockBackend',
    'social_auth.backends.contrib.yahoo.YahooOAuthBackend',
    'social_auth.backends.contrib.readability.ReadabilityBackend',
    'social_auth.backends.contrib.fedora.FedoraBackend',
    'social_auth.backends.OpenIDBackend',
    'django.contrib.auth.backends.ModelBackend',
)

LOGIN_URL = '/login-form/'
LOGIN_REDIRECT_URL = '/logged-in/'
LOGIN_ERROR_URL = '/login-error/'

urls.pu

urlpatterns = patterns('',
    # Examples:
    #(r'^$',main_page),
    url('',include('social.auth.urls'))

其实际指向urls.py

===============>>#1 票数:1

social_auth应用程序设置:

INSTALLED_APPS = (
    ...
    'social_auth'
)

好的,我知道了您的问题,您正在使用social.auth.urls但是您应该使用social_auth.urls

在urls.py中:

urlpatterns = patterns('',
    ...
    url(r'', include('social_auth.urls')),
    ...
)

链接http://django-social-auth.readthedocs.org/en/latest/configuration.html

  ask by user1050619 translate from so

未解决问题?本站智能推荐: