【问题标题】:Difficulty using Django-AllAuth Example application使用 Django-AllAuth 示例应用程序的困难
【发布时间】:2013-06-21 11:57:02
【问题描述】:

我正在开发一个网站,我想在其中使用 Django-AllAuth 来允许用户使用 Facebook 登录。但是,我有点难过。当我运行示例代码然后转到示例主页模板中的“注册”时,我会收到此处底部显示的错误消息。我做错了什么?

我想知道是否需要采取更多步骤才能完成这项工作。我知道管理页面为您提供了注册虚拟应用程序的选项 - 但我不确定我是否理解这是为了什么。我是否需要制作自己的“身份验证应用程序”供用户用于登录?或者这是否用于集成我可能为其他目的开发的外部应用程序(因此,不需要登录)?

以下 Django 错误:

TemplateSyntaxError at /accounts/signup/

'uni_form_tags' is not a valid tag library: Template library uni_form_tags not found, tried django.templatetags.uni_form_tags,django.contrib.staticfiles.templatetags.uni_form_tags,django.contrib.admin.templatetags.uni_form_tags,allauth.account.templatetags.uni_form_tags,allauth.socialaccount.templatetags.uni_form_tags

    Request Method:     GET
    Request URL:    http://localhost:8000/accounts/signup/
    Django Version:     1.5.1
    Exception Type:     TemplateSyntaxError
    Exception Value:    

'uni_form_tags' is not a valid tag library: Template library uni_form_tags not found, tried django.templatetags.uni_form_tags,django.contrib.staticfiles.templatetags.uni_form_tags,django.contrib.admin.templatetags.uni_form_tags,allauth.account.templatetags.uni_form_tags,allauth.socialaccount.templatetags.uni_form_tags

Exception Location:     /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in load, line 1044
Python Executable:  /usr/bin/python
Python Version:     2.7.3
Python Path:    

['/home/snares/sampleapp/django-allauth/example',
 '/usr/local/lib/python2.7/dist-packages/pip-1.3.1-py2.7.egg',
 '/usr/local/lib/python2.7/dist-packages/django_allauth-0.12.0_dev-py2.7.egg',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

Server time:    Mon, 24 Jun 2013 15:23:10 -0500

【问题讨论】:

    标签: python django facebook oauth django-allauth


    【解决方案1】:

    uni_form_tags 未找到。这意味着您没有安装django-uni-form 或者它没有被{% load uni_form_tags %} 包含在您的模板中

    【讨论】:

    • 您好阿巴索夫,感谢您的快速回复。我确实安装了 django-uni-form。我还假设因为这是示例 Django 项目,所以所有内容都将包含在内,并且这将是一个经过测试的应用程序,但也许我错了。当我今晚有机会时,我将测试包含是否存在并重新安装 djang-uni-form,但我并不乐观,因为我认为这应该开箱即用。跨度>
    【解决方案2】:

    你不需要统一来测试 django-allauth。

    我刚刚尝试了以下方法,它的工作完美无缺

               1.  cd django-allauth-master/example
    
    [optional] 2.  virtualenv --no-site-packages env
    [optional] 3.  source env/bin/activate
    
               4.  pip install -r requirements.txt
               5.  python manage.py syncdb
               6.  python manage.py runserver
    

    在 bowser 中转到 127.0.0.1:8000/accounts/login/,你应该有你的页面。

    测试后-------- 要使实际的社交登录起作用,您需要从他们的网站(http://developers.facebook.comhttps://code.google.com/apis/console/ 等)创建相应的应用程序。并在127.0.0.1:8000/admin/socialaccount/socialapp/中提供每个应用程序的KEY和SECRET

    【讨论】:

      【解决方案3】:

      这似乎是示例的错误(我刚刚提交) https://github.com/pennersr/django-allauth/issues/425.

      【讨论】:

        猜你喜欢
        • 2017-11-13
        • 2021-10-29
        • 2023-02-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-03-08
        • 2016-04-30
        • 1970-01-01
        相关资源
        最近更新 更多