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
7 def wait(request, path):
8 if WaitedFile.exists(path):
9 file_url = join(WAITER_URL, path)
12 waiting = get_object_or_404(WaitedFile, path=path)
13 if waiting.is_stale():
17 return HttpResponse(file_url)
19 return render(request, "waiter/wait.html", locals())