2 View-specific utilities.
5 from django.conf import settings
6 from django.http import HttpResponse, HttpResponseRedirect
10 """Serves an URL either though Nginx's X-accel, or by redirection."""
11 if settings.X_ACCEL_REDIRECT:
12 response = HttpResponse()
13 response['Content-Type'] = ""
14 response['X-Accel-Redirect'] = url
17 return HttpResponseRedirect(url)