Django 引荐来源问题
我想知道谁引用了我的网页,因此在我的模型中我有:
referrer = models.CharField(max_length=30, default='google', verbose_name=_('referrer'), help_text=_('Referrer'))This are the URL's for my page:
url(r'^$', app_views.index, name='index_default')and
url(r'^(\w+)/$', app_views.index, name='index_default2')I want to send my referrer parameter to the flash embeddeded within my HTML along flashvars:
< param name="FlashVars" value="referrer={{ referrer }}" />How should the view look like in order to catch the referrer matched with the regular expression? Something like
def index(request): return render_to_response('index.html', { 'referrer':referrer, }, context_instance=RequestContext(request))
I want to know who refers my webpage, so in my models I have:
referrer = models.CharField(max_length=30, default='google', verbose_name=_('referrer'), help_text=_('Referrer'))
This are the URL's for my page:
url(r'^and
url(r'^(\w+)/I want to send my referrer parameter to the flash embeddeded within my HTML along flashvars:
< param name="FlashVars" value="referrer={{ referrer }}" />How should the view look like in order to catch the referrer matched with the regular expression? Something like
def index(request): return render_to_response('index.html', { 'referrer':referrer, }, context_instance=RequestContext(request)), app_views.index, name='index_default')and
I want to send my referrer parameter to the flash embeddeded within my HTML along flashvars:
How should the view look like in order to catch the referrer matched with the regular expression? Something like
, app_views.index, name='index_default2')
I want to send my referrer parameter to the flash embeddeded within my HTML along flashvars:
How should the view look like in order to catch the referrer matched with the regular expression? Something like
, app_views.index, name='index_default')and
I want to send my referrer parameter to the flash embeddeded within my HTML along flashvars:
How should the view look like in order to catch the referrer matched with the regular expression? Something like
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在请求的元字典中有一个 HTTP_REFERER 值..我认为这可以帮助你
in the meta dictionary of request there is a HTTP_REFERER value .. I think that can help you