django-allauth未捕获的ReferenceError [英] django-allauth Uncaught ReferenceError

查看:147
本文介绍了django-allauth未捕获的ReferenceError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法理解为什么会得到:

I cannot work out why I am getting:

未捕获的ReferenceError:allauth未定义

Uncaught ReferenceError: allauth is not defined

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

...when clicking the Facebook link at: https://obscure-harbor-7751.herokuapp.com/accounts/signup/ hosted on Heroku. There is no related javascript rendered to the page, but I don't know where allauth would handle that from.

我很确定所有相关设置都是正确的(贴在下面)。我认为它之前工作并且不知何故停止了工作(可能是因为部署时需要更新)。我正在使用django-cookiecutter。

I'm quite sure that all relevant settings are correct (pasted below). I think it was working before and somehow stopped working of late (possibly due to an update pulled as a requirement on deployment). I am using django-cookiecutter.

任何人都可以建议问题是什么?我尝试了很多东西,并在网上寻找一个实时的例子,看看我应该期待什么样的js但却找不到。

Can anyone suggest what the problem might be? I've tried many things and looked for a live example online to see what sort of js i should expect but couldn't find any.

请帮忙!

谢谢,

相关设置:

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',
)


推荐答案

使用以下可能更好:

{% providers_media_js %}

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

这篇关于django-allauth未捕获的ReferenceError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆