Start implementing basic CMS functionality for main page

This commit is contained in:
2022-07-21 13:50:25 +01:00
parent fd310cc7e8
commit c52c3e1924
9 changed files with 169 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ from django.views.generic.edit import CreateView
from core.forms import NewUserForm
from core.lib.products import assemble_plan_map
from core.models import Plan, Session
from core.models import ContentBlock, Plan, Session
pp = pprint.PrettyPrinter(indent=4)
@@ -22,7 +22,11 @@ class Home(View):
template_name = "index.html"
def get(self, request):
return render(request, self.template_name)
blocks = ContentBlock.objects.all().order_by("position")
print("BLOCKS", blocks)
print("ITER", [x.position for x in blocks])
context = {"blocks": blocks}
return render(request, self.template_name, context)
class Billing(LoginRequiredMixin, View):