Reputation: 785
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.
Upvotes: 1
Views: 142
Reputation: 9116
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.
Upvotes: 3