mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-09-21 16:33:22 +00:00
15 lines
469 B
Python
15 lines
469 B
Python
# coding=utf-8
|
|
from django.conf import settings
|
|
from django.http import HttpResponse, Http404
|
|
|
|
from rest_framework.views import APIView
|
|
|
|
|
|
class AdminTemplateView(APIView):
|
|
def get(self, request, template_dir, template_name):
|
|
path = settings.TEMPLATE_DIRS[0] + "/admin/" + template_dir + "/" + template_name + ".html"
|
|
try:
|
|
return HttpResponse(open(path).read(), content_type="text/html")
|
|
except IOError:
|
|
raise Http404
|