我正在使用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.
更多推荐
发布评论