在POST之后,奇怪的重定向到iana.org(After POST, weird redirect to iana.org follows)

编程入门 行业动态 更新时间:2024-10-26 17:26:04
在POST之后,奇怪的重定向到iana.org(After POST, weird redirect to iana.org follows)

我正在使用django-voting: https : //github.com/brosner/django-voting/tree/master/voting在我的帖子之后,我被重定向到这里: http : //www.iana.org/domains/例如/#C40

<form method="POST" action="/comments/{{ comment.id }}/up/vote/"> {% csrf_token %} <button type="submit">Thumbs Up!</button> </form>

投票已创建,我可以在管理员中看到它。

没有在我的应用程序中我有这种重定向。 我也无法在django-voting中找到这行代码,它将具有此重定向。 这是否发生在其他任何人身上,如果是这样,你怎么解决这个问题?

我只想在投票后重定向同一页面。 所以我尝试<input type="hidden" name="next" value="{{ event.get_absolute_url }}" />认为它可能会覆盖。 但这似乎不起作用。 建议?

I'm using django-voting: https://github.com/brosner/django-voting/tree/master/voting And after my post, I'm redirected here: http://www.iana.org/domains/example/#c40

<form method="POST" action="/comments/{{ comment.id }}/up/vote/"> {% csrf_token %} <button type="submit">Thumbs Up!</button> </form>

The vote is created and I can see it in the admin.

No where in my application do I have this kind of redirect. Nor can I find this line of code in django-voting where it would have this redirect. Has this happened to anyone else, if so how'd you solve this?

I just want to be redirected the same page after the casted the vote. So I tried <input type="hidden" name="next" value="{{ event.get_absolute_url }}" /> thinking that it might override. But this doesn't seem to work. Suggestions?

最满意答案

我猜你的逻辑中某处你重定向到"example.com" 。 example.com归IANA所有,并重定向到http://www.iana.org/domains/example/ 。

此外,网址末尾的“#c40”让我觉得Django正在尝试使用c40锚点重定向回某个页面,可能是为了让您在视图中投票。

I'm guessing that somewhere in your logic you redirect to "example.com". example.com is owned by the IANA and redirects to http://www.iana.org/domains/example/.

Also, the "#c40" at the end of the url makes me think that Django is trying to redirect back to some page with a c40 anchor, possibly in order to have the thing you just voted on in view.

更多推荐

本文发布于:2023-08-01 21:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1365724.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   奇怪   POST   iana   redirect

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!