Update problem.py
Fixed, if you follow the docs of DMOJ to setup nginx and supervisor, Pdf view won't work
This commit is contained in:
parent
36007e86ed
commit
465dd08043
1 changed files with 5 additions and 5 deletions
|
@ -431,9 +431,9 @@ class ProblemPdfDescriptionView(ProblemMixin, SingleObjectMixin, View):
|
|||
if not problem.pdf_description:
|
||||
raise Http404()
|
||||
response = HttpResponse()
|
||||
if request.META.get("SERVER_SOFTWARE", "").startswith("nginx/"):
|
||||
response["X-Accel-Redirect"] = problem.pdf_description.path
|
||||
else:
|
||||
#if request.META.get("SERVER_SOFTWARE", "").startswith("nginx/"):
|
||||
# response["X-Accel-Redirect"] = problem.pdf_description.path
|
||||
#else:
|
||||
with open(problem.pdf_description.path, "rb") as f:
|
||||
response.content = f.read()
|
||||
|
||||
|
|
Loading…
Reference in a new issue