python - Error 401 when trying to register a new user. Works fine on localhost (Django rest api)
问题描述
I have built a rest API using Django. I have tested the endpoints and everything seems to be working fine on localhost.However after deploying to digital ocean and trying to access the endpoint to register a new user. I get Error 401. What could be the problem?
解决方案
可能是一个长镜头,但如果我在调用 URL 而不是 HTTPS 时使用 HTTP 和/或忘记在末尾使用斜杠调用路由,我也会遇到类似的问题。最终会发生的是请求会出于某种原因丢弃令牌数据。
推荐阅读
- perforce - p4python 创建并提交一个新文件
- javascript - 如何在javascript中回到数组的开头
- php - 如何修复“调用未定义函数 mysqli_init()”错误
- .net - 没有(或默认)操作名称的 MVC 路由
- c# - Xamarin.Forms itext7 - 没有关联 PdfWriter 用于制作间接
- javascript - 当浏览器窗口完全加载时,使用 fadeOut() 或 hide() 淡入/隐藏 Bootstrap 4 微调器/加载器
- r - randomForest 中的错误,NA,对象中的缺失值
- javascript - 如何严格限制函数或块内的范围?
- java - 无法在 Spring Boot 中查看缓存指标(命中/未命中/大小)?
- nvda - NVDA 插件是否能够在 NVDA 启动/关闭时执行?