javascript – django-allauth未捕获的ReferenceError
作者:互联网
我无法理解为什么我会得到:
未捕获的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',
)
解决方法:
使用以下可能更好:
{% providers_media_js %}
参考:http://django-allauth.readthedocs.org/en/latest/templates.html
标签:django-allauth,javascript,python,authentication,django 来源: https://codeday.me/bug/20190830/1771448.html