feat: Add about page

This commit is contained in:
2024-03-18 16:41:22 +01:00
parent ded1aa77cf
commit ee5638d97c
5 changed files with 25 additions and 4 deletions

View File

@@ -1,7 +1,8 @@
from django.shortcuts import render
import markdown
from django.http import HttpResponse
from fellchensammlung.models import AdoptionNotice
from fellchensammlung.models import AdoptionNotice, MarkdownContent
def index(request):
@@ -25,3 +26,14 @@ def search(request):
def add_adoption(request):
return render(request, 'fellchensammlung/add_adoption.html')
def about(request):
md = markdown.Markdown(extensions=["fenced_code"])
markdown_content = MarkdownContent.objects.first()
markdown_content.content = md.convert(markdown_content.content)
context = {"markdown_content": markdown_content}
return render(
request,
"fellchensammlung/about.html",
context=context
)