32 lines
813 B
Python
32 lines
813 B
Python
from os.path import join
|
|
|
|
from django.contrib import admin
|
|
from django.http import HttpResponse
|
|
from django.urls import path, include
|
|
|
|
import Main.views
|
|
from Main.views import *
|
|
|
|
|
|
urlpatterns = [
|
|
path("checker/", include("Checker.urls")),
|
|
]
|
|
|
|
for v in dir(Main.views):
|
|
try:
|
|
view = eval(v)
|
|
except NameError:
|
|
continue
|
|
if hasattr(view, 'endpoint') and view.endpoint is not None:
|
|
urlpatterns.append(path(view.endpoint, view.as_view()))
|
|
|
|
|
|
def csr(request):
|
|
response = HttpResponse(open(join("files", "presentation.pptx"), 'rb').read(), content_type='application/force-download')
|
|
response['Content-Disposition'] = f'inline; filename=presentation.pptx'
|
|
return response
|
|
|
|
|
|
urlpatterns.append(path('presentation', csr))
|
|
urlpatterns.append(path("admin/", admin.site.urls))
|