django-allauth未捕获的引用错误

3
我无法弄清楚为什么会出现以下错误:

Uncaught ReferenceError: allauth未定义

...当在Heroku上托管的https://obscure-harbor-7751.herokuapp.com/accounts/signup/点击Facebook链接时。页面上没有相关的JavaScript,但我不知道allauth会从哪里处理它。

我非常确定所有相关设置都是正确的(如下所示)。我认为之前它是有效的,但最近停止工作了(可能是由于部署时拉取的更新要求)。我正在使用django-cookiecutter。

有人能建议一下问题可能是什么吗?我尝试了很多方法,并寻找了在线实例以查看应该期望什么样的js,但找不到任何内容。

请帮帮我!

谢谢,

相关设置:


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',
    'django.core.context_processors.request',
    "allauth.account.context_processors.account",
    "allauth.socialaccount.context_processors.socialaccount",
    # Your stuff: custom template context processers go here
)

AUTHENTICATION_BACKENDS = (
    "django.contrib.auth.backends.ModelBackend",
    "allauth.account.auth_backends.AuthenticationBackend",
)

INSTALLED_APPS += (
    # Needs to come last for now because of a weird edge case between
    #   South and allauth
    'allauth',  # registration
    'allauth.account',  # registration
    'allauth.socialaccount',  # registration
    'allauth.socialaccount.providers.facebook',
)
2个回答

3
使用以下内容可能更好:
{% providers_media_js %}

参考: http://django-allauth.readthedocs.org/en/latest/templates.html

该链接提供了有关Django allauth模板的详细信息。它包含了所有可用的模板标签和过滤器,以及如何使用模板来自定义您的用户界面。如果你正在使用Django allauth来处理认证和邀请流程,这个链接将是非常有用的。

3
我需要补充一点内容:
{% include "socialaccount/snippets/login_extra.html" %}

要让页面出现javascript,需要转到templates/account/signup.html。我本以为这已经包含在内了。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接