tastypie 身份验证/自定义响应
是否有在 tastypie 中使用 APIKey 身份验证的示例?提供的示例并未真正详细说明其工作原理。
此外,我还在浏览食谱,试图找到在帖子上返回自定义消息的钩子。
例如,有人发帖尝试创建用户,但该用户已经存在。在我的 Hydro_user(self, bundle) 中:我相信我会进行检查,但是我如何返回有用的错误消息?
Are there any examples of using the APIKey authentication in tastypie. The example provided doesn't really go into detail on how it works.
Also I was looking through the cookbook trying to find where there is a hook for returning custom messages on a post.
For example someone does a post to try to create a user but the user already exists. In my hydrate_user(self, bundle): I believe i would do the check but how would i return a error message that is useful?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以这样做:
you can do that this way: