1 from os.path import join
2 from waiter.models import WaitedFile
3 from waiter.settings import WAITER_URL
4 from django.shortcuts import render, get_object_or_404
5 from django.http import HttpResponse
6 from django.views.decorators.cache import never_cache
10 def wait(request, path):
11 if WaitedFile.exists(path):
12 file_url = join(WAITER_URL, path)
15 waiting = get_object_or_404(WaitedFile, path=path)
16 if waiting.is_stale():
20 return HttpResponse(file_url)
22 return render(request, "waiter/wait.html", locals())