1

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.

user1379351
  • 723
  • 1
  • 5
  • 18

1 Answers1

3

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.

Community
  • 1
  • 1
Paul Collingwood
  • 9,053
  • 3
  • 23
  • 36