django - Django:“使用 Facebook 登录”按钮在部署到 pythonanywhere 后不起作用
问题描述
当我在 localhost 中运行该应用程序时,它工作正常。但部署到 pythonanywhere 后,使用 Facebook按钮登录不起作用。
当我刷新登录页面时,在控制台中,它显示 =>
Failed to load resource: https://username.pythonanywhere.com/static/facebook/js/fbconnect.js the server responded with a status of 404 (Not Found)
Refused to execute https://username.pythonanywhere.com/static/facebook/js/fbconnect.js as script because "X-Content-Type: nosniff" was given and its Content-Type is not a script MIME type.
在模板中:
<a href="{% provider_login_url 'facebook' method='js_sdk' %}"><button class="effect" style="width: 100%; background-color: rgb(58, 110, 255); height: 36px; border: none; color: white; border-radius: 3px; display: flex; justify-content: center;align-items: center;"><img style="height: 24px; width: 24px; background-color: white; padding: 1px; border-radius: 50%;" src="{% static 'images/fblogo.png' %}" alt=""><span style="margin-top: 2px; display: block; margin-left: 8px; font-size: 16px;"> Login with Facebook</span></button></a> <br>
另一个问题是:CSS 没有加载到管理页面中
如何解决这个问题?
编辑:现在如果我点击“用 facebook 登录”按钮,它会显示,
ReferenceError: Can't find variable: allauth
现在要做什么?
解决方案
推荐阅读
- awk - 将文本文件与 awk 中的所有字段混合
- reactjs - redux-form 未触及字段验证在提交时失败
- python-3.x - Python:我只想在整行为空的情况下填充空值
- javascript - 如何删除单引号并将双引号放在javascript中的对象数组中
- foreign-keys - Kiwi TCMS 可以向 Bugzilla 报告 ID 问题吗?
- powershell - Powershell CSV foreach 循环
- c++ - Qt websocket,连接到服务器
- c# - 在 c# 中使用 aspnet_regiis 动态加密 web.config
- javascript - Next JS Router.push('/uri') 抛出“Cannot update during an existing state transition”警告
- vue.js - Vue、Vuex 和 Vue-Cli 用于发布带有 Vuex 模块的单文件组件库