Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 没有名为auth.url的模块_Python_Django - Fatal编程技术网

Python 没有名为auth.url的模块

Python 没有名为auth.url的模块,python,django,Python,Django,我试图使用Django Social auth进行Google auth,但出现以下错误: No module named auth.urls 设置.py AUTHENTICATION_BACKENDS = ( 'social_auth.backends.twitter.TwitterBackend', 'social_auth.backends.facebook.FacebookBackend', 'social_auth.backends.google.Google

我试图使用Django Social auth进行Google auth,但出现以下错误:

No module named auth.urls
设置.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/'
url.pu

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


它实际指向URL.py

社交认证应用程序设置:

INSTALLED_APPS = (
    ...
    'social_auth'
)
好的,我解决了你的问题,你使用的是像
social.auth.url
但是你应该使用
social\u auth.url

在URL.py中:

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

Link

您是否在已安装的应用程序中添加了social_auth?是的,我添加了,并运行了syncbd命令,结果非常糟糕..成功了…我给了social.auth而不是social_auth是的。我给出了同样的答案。