python - rest-auth 登录或注册后 Nginx 返回服务器错误 500
问题描述
我正在尝试使用 rest-auth 在我的 django 应用程序上设置身份验证。它在开发服务器上完美运行,然后我推送到生产环境并在每次成功登录或注册后开始收到服务器错误 500。
这是我的 urls.py 文件:
urlpatterns = [
path('admin/', admin.site.urls),
path('rest-auth/', include('rest_auth.urls')),
path('rest-auth/registration/', include('rest_auth.registration.urls')),
path('api/', include('backend.urls')),
]
这是我的 nginx 配置文件:
location /{
include proxy_params;
proxy_pass http://unix:/myapp/path/gunicorn.sock;
}
即使 /rest-auth/login 也可以正确打开每条路线,但是一旦我提交登录表单或注册表单,我就会收到服务器错误,但它永远不会在开发服务器上发生。
我试图在 nginx conf 中进行更改,但没有成功。其他所有路线都有效,这个问题可能出在 nginx 或 rest-auth 上(它适用于开发)吗?
解决方案
推荐阅读
- git - 无法使用 Sourcetree 克隆存储库
- cloud-foundry - CF 市场未找到服务产品
- prolog - maplist 仅适用于列表列表的第一个列表?
- javascript - 我应该使用 Python 还是 Javascript 来使用 Django 构建基于文本的冒险?
- r - 在ggplot 2中的x轴上将时间从几分钟缩放到几小时
- swift - 在 SwiftUI Document App 中,如何从函数中保存文档
- python - augemtation 错误,tensorflow.python.keras.preprocessing.image.ImageDataGenerator
- python - 如何在 Superset 中以编程方式向角色添加权限?
- istio - 多集群 istio 而不暴露集群之间的 kubeconfig
- sequelize.js - Sequelize 不使用 findOrCreate 将内容写入数据库