我正在尝试使用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 conf:
location /{
include proxy_params;
proxy_pass http://unix:/myapp/path/gunicorn.sock;
}
即使/ rest-auth / login,每条路径都可以正确打开,但是一旦我提交了登录表单或注册表单,我就会收到服务器错误,但是在开发服务器上却永远不会发生。
我试图在nginx conf中进行更改,但是没有用。其他所有途径都行得通,这个问题可能与nginx或rest-auth(在开发中起作用)有关吗?