update example to use signposting.Signpost

This commit is contained in:
Daniel Bauer
2024-11-08 17:44:48 +01:00
parent cbd621435c
commit 76e791914d

View File

@@ -1,12 +1,16 @@
from django.http import HttpResponse
from django_signposting.utils import add_signposts
from signposting import Signpost, LinkRel
def my_view(request):
response = HttpResponse("Hello, world!")
# Add signpostings as string
add_signposts(response,
type="https://schema.org/Dataset",
author="https://orcid.org/0000-0001-9447-460X")
add_signposts(
response,
Signpost(LinkRel.type, "http://schema.org/Dataset"),
Signpost(LinkRel.author, "https://orcid.org/0000-0001-9447-460X")
)
return response