plchweb/base_app/views.py

41 lines
921 B
Python
Raw Normal View History

2021-07-16 14:11:42 +00:00
from django.shortcuts import render
2021-07-19 13:13:27 +00:00
from django.shortcuts import render, redirect
from django.views.generic import TemplateView, FormView
import json
# Helper functions
def get_domains():
domains = None
with open("data/domains.json", "r") as f:
data = f.read()
domains = json.loads(data)
return domains
# Create your views here.
2021-07-19 13:13:27 +00:00
class IndexView(TemplateView):
def get(self, request, *args, **kwargs):
return render(request, "index.html", {})
2021-07-19 18:56:15 +00:00
class CVView(TemplateView):
def get(self, request, *args, **kwargs):
return render(request, "cv.html", {})
class LoremView(TemplateView):
def get(self, request, *args, **kwargs):
return render(request, "lorem.html", {})
2021-07-19 13:13:27 +00:00
class UkraineView(TemplateView):
def get(self, request, *args, **kwargs):
domains = get_domains()
return render(request, "ukraine.html", {"domains" : domains})