KeyError fix for direct url access

Got a KeyError when hitting /ratings/rate/x/x/x url directly in the browser so I thought it would be better to use get() with request.META to avoid getting KeyError, andadditionally handling an AttributeError exception when there is no HTTP_REFERER in which it will return a blank http response instead of an ugly error