Google App Engine:流量来源 [英] Google App Engine: traffic source
本文介绍了Google App Engine:流量来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢。
解决方案
def get(self):
referer = self.request.headers.get(Referer)
#如果标题中没有引用referer,则为None。
我刚刚在 console :
import os
os .environ ['HTTP_REFERER']
然后返回
'http://con.appspot.com/console/'
然而,在使用之前检查它是否在那里。
Is there a way to identify where traffic to a Google App Engine website is coming from? e.g. the previous website that the user was on?
Thanks.
解决方案
From How to implement hotlinking prevention in Google App Engine
def get(self):
referer = self.request.headers.get("Referer")
# Will be None if no referer given in header.
And I've just tried this in the console:
import os
os.environ['HTTP_REFERER']
And it returned
'http://con.appspot.com/console/'
Check if it's there first before using however.
这篇关于Google App Engine:流量来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文