如何从Django Request对象访问url hash / fragment [英] How to access url hash/fragment from a Django Request object

查看:238
本文介绍了如何从Django Request对象访问url hash / fragment的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Django的请求对象?

As in the title: how can I access the url hash/fragment (the part following the dash #) from a Django view and so, I suppose, from a Django Request object?

我没有找到足够的关于这里可用的文档的信息: http://docs.djangoproject.com/zh/dev/ref/request-response/

I've not found enough information on the documentation here available: http://docs.djangoproject.com/en/dev/ref/request-response/

PS
假设片段部分发送到服务器(在我的具体情况下,因为它不是浏览器发送请求)。

P.S. Suppose that the fragment part is sent to the server (it is so in my specific case since it's not a browser to send the request).

推荐答案

按照定义,这不会发送到服务器。从 URI参考:URI上的片段标识符

This is not sent to the server, by definition. From URI References: Fragment Identifiers on URIs :


HTTP引擎无法对此做出任何假设,服务器甚至没有给出它。

"The HTTP engine cannot make any assumptions about it. The server is not even given it."

这篇关于如何从Django Request对象访问url hash / fragment的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆