first commit

This commit is contained in:
2021-05-14 14:41:00 +05:30
commit b9f8614ddf
385 changed files with 31180 additions and 0 deletions

21
app/views.py Normal file
View File

@@ -0,0 +1,21 @@
from django.shortcuts import render, get_object_or_404, redirect
from django.template import loader
from django.http import HttpResponse
def index(request):
return render(request, "index.html")
def pages(request):
context = {}
# All resource paths end in .html.
# Pick out the html file name from the url. And load that template.
try:
load_template = request.path.split('/')[-1]
template = loader.get_template('pages/' + load_template)
return HttpResponse(template.render(context, request))
except:
template = loader.get_template( 'pages/error-404.html' )
return HttpResponse(template.render(context, request))