0

how can I check the HTTP_REFERER while serving an image from my django app?

The thing is, all static and media files are served by nginx and my django app doesnot even worry about them, right?

do I need a new view function to catch all image urls and check their http_referer in this function? but I dont feel good with this idea.. what is the best way for this?

doniyor
  • 36,596
  • 57
  • 175
  • 260
  • 3
    What are you trying to do / why are you trying to do it? As you mentioned, Nginx will handle serving your static assets. Regardless, [this may help you](http://stackoverflow.com/questions/4406377/django-request-to-find-previous-referrer) – rnevius Apr 28 '15 at 10:18
  • 1
    If you are trying to prevent [hotlinking](http://en.wikipedia.org/wiki/Inline_linking), this must be done in nginx, here is a [tutorial](http://www.nginxtips.com/how-to-stop-image-hotlinking-on-nginx/). – aumo Apr 28 '15 at 10:24

0 Answers0