标签: django-allauth

由于"没有名为path.to的模块",Django allauth找不到/ accounts/login视图

我已经安装了django_allauth但是accounts/login视图显示了这个错误.

ImportError at /accounts/login/
No module named path.to
Request Method: GET
Request URL:    http://chew.local:5000/accounts/login/
Django Version: 1.5.1
Exception Type: ImportError
Exception Value:    
No module named path.to
Exception Location: /Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable:  /Users/benbowler/Sites/Repositories/chew/venv/bin/python
Python Version: 2.7.2
Python Path:    
['/Users/benbowler/Sites/Repositories/chew',
 '/Users/benbowler/Sites/Repositories/chew/venv/bin',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python27.zip',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/plat-darwin',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/plat-mac',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Users/benbowler/Sites/Repositories/chew/venv/Extras/lib/python',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/lib-tk',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/lib-old',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/lib-dynload',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/site-packages']
Server time:    Thu, 16 May 2013 15:01:20 +0100
Run Code Online (Sandbox Code Playgroud)

providers_media_js下面是红色:

Error during template rendering

In template /Users/benbowler/Sites/Repositories/chew/venv/lib/python2.7/site-packages/allauth/templates/socialaccount/snippets/login_extra.html, error at line 3 …
Run Code Online (Sandbox Code Playgroud)

python django django-allauth

5
推荐指数
1
解决办法
2516
查看次数

django-allauth google integration会出现"社交网络登录失败"错误

我正在外部网站上集成django-allauth用于facebook和谷歌登录.Facebook的工作几乎开箱即用.但是,有了Google,我收到了"社交网络登录失败"错误.

这是我做的:

1.Google API控制台:Web应用程序配置的客户端ID

 Client ID: xxxxxxx.apps.googleusercontent.com
 Email address: yyyyyyyy@developer.gserviceaccount.com
 Client secret: xxx-yyy-zzz-111-222
 Redirect URIs: http://learnbuzz.com/accounts/google/login/callback/
 JavaScript origins: http://www.learnbuzz.com
Run Code Online (Sandbox Code Playgroud)

2.在Sites中处理learnbuzz.com网站

3.使用Google API控制台中的客户端ID和密码修复社交应用中的Google应用.

从文档和其他一些SO问题看来,这就是所需要的.

但是,当我使用谷歌登录时,我进入了accounts.google.com要求用户接受"应用程序共享基本用户信息和电子邮件"的页面.在我接受后,它为我提供了此网址的"社交网络登录失败":

http://learnbuzz.com/accounts/google/login/callback/?state=l1WdxOgr26bB&code=4/lGhX6Dum_FNnM3FE39TcULZb1UMX.0jX6biQfm3MfEnp6UAPFm0F0CIGMgQI

我错过了什么配置?

编辑:我不知道它是否重要但它需要浏览器相当一段时间才能抛出此错误.

django google-openid django-openid-auth django-allauth

5
推荐指数
1
解决办法
1119
查看次数

使用 django-allauth 的多个注册流程和配置文件类型

我有两种用户一种用户必须付费才能注册到该站点,并且他可以执行一系列操作。在第二个可以注册和登录免费(与他们的Facebook或谷歌或用户名和密码),并可以执行不同的一套动作。

两者都需要有个人资料和自定义字段,当然,用户类型会有所不同。

  • 是否可以使用django-allauth来实现?
  • 如果不是,使用另一个注册应用程序(例如django-registration)来处理付费用户和 django-allauth 用于社交登录是个好主意吗?他们会冲突吗?
  • 更好的方法来做到这一点?

django django-profiles django-registration django-users django-allauth

5
推荐指数
0
解决办法
325
查看次数

如何创建用于测试目的的 django-allauth 常规和社交帐户?

设法创建了一个普通用户,就像使用Django-allauth登录时一样

我一直在尝试为社交帐户(Github)做同样的事情,但我真的很挣扎。我想这里一定有人为了测试目的而必须创建一个社交帐户。谁能展示一下他们是如何做到的?

此外,如果您知道创建普通用户的更好方法,我们将不胜感激。

django unit-testing django-allauth

5
推荐指数
1
解决办法
2416
查看次数

django-allauth 移动客户端 csrf 保护

我想django-allauth通过移动客户端使用服务。当我请求登录时,注册页面会csrf protection出现错误以防止跨站点请求。我可以通过在应用程序模块的方法中csrf_exempt添加标签来解决这个问题,但我不知道这是否是处理这个问题的正确方法。我不想破坏. 除了这个,我还能做什么,我可以要求一个吗?dispatchdjango-allauthdjango-allauthcsrfmiddlewaretoken

django django-csrf django-allauth

5
推荐指数
1
解决办法
276
查看次数

ImportError:没有名为allauth的模块

我已经安装了django-allauth在我的django应用程序中使用社交帐户,但每次我尝试

manage.py syncdb

它给了我一个错误

ImportError:没有名为allauth的模块

我试着添加偶数

sys.path.append(os.path.abspath(os.path.dirname(__file__)))
Run Code Online (Sandbox Code Playgroud)

manage.py 
Run Code Online (Sandbox Code Playgroud)

但它仍然无法正常工作.我无法调试如何添加allauth路径以包含它?

django django-allauth

5
推荐指数
1
解决办法
3811
查看次数

Django自定义500错误模板未显示request.user

我正在实现自定义404和500模板,但是404.html模板似乎返回request.user.is_authenticated很好,但是500.html模板无法返回任何内容。我还检查了request.user,它在500页上只是空白。

这很奇怪,因为当我触发500错误时,我收到了预期的错误报告电子邮件,并且显然在请求明细中正确定义了USER。这是我在views.py中使用的代码:

def handler404(request):
    response = render_to_response('404.html', {},
                                  context_instance=RequestContext(request))
    response.status_code = 404
    return response


def handler500(request):
    response = render_to_response('500.html', {},
                                  context_instance=RequestContext(request))
    response.status_code = 500
    return response
Run Code Online (Sandbox Code Playgroud)

我想知道后台(也许在RequestContext中)是否在处理500与404不同的问题?我应该提到,我也在使用django-guardian,尽管我认为这不会影响任何情况。有任何想法吗?

编辑: 此评论声称“ 500模板将不会呈现request.user,因为它报告了500服务器错误,因此服务器无法提供任何服务。” 有谁知道解决这个问题的方法吗?似乎应该有一个,因为,就像我说的那样,我在错误报告电子邮件中收到的日志显然带有带有用户名的请求对象。

编辑2:现在我想知道它是否与django-allauth有关-我也在使用它。

django django-templates django-errors django-allauth django-1.6

5
推荐指数
1
解决办法
2470
查看次数

邀请用户 django-allauth

我想介绍一个流程,我们已经在使用 allauth 并想尝试使其与 allauth 一起使用(可能会添加另一个包):

  1. 通过指定他的电子邮件邀请新用户(仅。不需要密码)
  2. 用户收到一封电子邮件,点击邀请链接并进入一个已经填写了他的电子邮件的表单,他需要填写更多字段,例如密码、名字和姓氏以及一些我将添加到的自定义字段用户模型
  3. 用户点击确认并登录,重定向到根 URL

django django-allauth

5
推荐指数
1
解决办法
3324
查看次数

django-allauth 使用参数“()”和关键字参数“{}”未找到的“account_confirm_email”返回错误反向

我正在使用 django-allauth 和 django rest-auth。

这是堆栈跟踪:

[2016-02-15 23:45:35,093] ERROR [base:handle_uncaught_exception:256 8977] Internal Server Error: /api/rest-auth/registration/
Traceback (most recent call last):                                              
  File "/home/.../webapps/project_test/lib/python2.7/Django-1.8.7-py2.7.egg/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)     
  File "/home/.../webapps/project_test/lib/python2.7/Django-1.8.7-py2.7.egg/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)                                           
  File "/home/.../webapps/project_test/lib/python2.7/Django-1.8.7-py2.7.egg/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)                              
  File "/home/.../webapps/project_test/.ve/lib/python2.7/site-packages/rest_framework/views.py", line 452, in dispatch
    response = self.handle_exception(exc)                                       
  File "/home/.../webapps/project_test/.ve/lib/python2.7/site-packages/rest_framework/views.py", line 449, in dispatch
    response = handler(request, *args, **kwargs)                                
  File "/home/.../webapps/project_test/.ve/lib/python2.7/site-packages/rest_auth/registration/views.py", line 44, in post
    self.form_valid(self.form)                                                  
  File "/home/.../webapps/project_test/.ve/lib/python2.7/site-packages/rest_auth/registration/views.py", line …
Run Code Online (Sandbox Code Playgroud)

django django-allauth django-rest-auth

5
推荐指数
1
解决办法
2181
查看次数

Django Allauth错误:“'socialaccount'不是注册的标记库”

我下面的使用说明Django的allauth如图所示这里。我对使用社交身份验证不感兴趣-只是一个简单的电子邮件和密码注册流程。由于某种原因,当我去的时候/accounts/login/我得到了错误

TemplateSyntaxError at /accounts/login/
'socialaccount' is not a registered tag library. Must be one of:
account
account_tags
...
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

在我settings.py我有

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]


# Required by allauth
AUTHENTICATION_BACKENDS = (
    # Needed to login by username in Django admin, regardless of `allauth`
    'django.contrib.auth.backends.ModelBackend',

    # `allauth` specific authentication methods, such as login by e-mail
    'allauth.account.auth_backends.AuthenticationBackend', …
Run Code Online (Sandbox Code Playgroud)

python django django-allauth

5
推荐指数
1
解决办法
2407
查看次数