mirror of
https://github.com/dnlbauer/django-signposting.git
synced 2026-09-10 22:15:30 +00:00
update example to use signposting.Signpost
This commit is contained in:
@@ -1,12 +1,16 @@
|
|||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django_signposting.utils import add_signposts
|
from django_signposting.utils import add_signposts
|
||||||
|
|
||||||
|
from signposting import Signpost, LinkRel
|
||||||
|
|
||||||
def my_view(request):
|
def my_view(request):
|
||||||
response = HttpResponse("Hello, world!")
|
response = HttpResponse("Hello, world!")
|
||||||
|
|
||||||
# Add signpostings as string
|
# Add signpostings as string
|
||||||
add_signposts(response,
|
add_signposts(
|
||||||
type="https://schema.org/Dataset",
|
response,
|
||||||
author="https://orcid.org/0000-0001-9447-460X")
|
Signpost(LinkRel.type, "http://schema.org/Dataset"),
|
||||||
|
Signpost(LinkRel.author, "https://orcid.org/0000-0001-9447-460X")
|
||||||
|
)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
Reference in New Issue
Block a user