human.json implementation as Django app
Find a file
Timo Zimmermann 92616fde6e
Some checks failed
Tests / PyTest (push) Has been cancelled
fix packaging
2026-03-21 15:03:35 +00:00
.forgejo/workflows update readme 2026-03-21 11:37:24 +00:00
dj_human_json add unique constraint 2026-03-21 09:58:23 +00:00
tests initial commit 2026-03-20 18:09:52 +00:00
.gitignore test with Django 4.x and 5.x 2026-03-21 11:52:10 +00:00
.python-version initial commit 2026-03-20 18:09:52 +00:00
pyproject.toml fix packaging 2026-03-21 15:03:35 +00:00
pytest.ini initial commit 2026-03-20 18:09:52 +00:00
README.md fix packaging 2026-03-21 15:03:35 +00:00
uv.lock test with Django 4.x and 5.x 2026-03-21 11:52:10 +00:00

Django Human.json

This package implements the human.json protocol. The current supported protocol version is 0.1.1. Django admin is setup to create vouchers.

Setup

dj_human_json can be installed via PyPI or you can simply copy the dj_human_json directory in this repository into your Django project.

pip install django-human-json

Once you added dj_human_json to your INSTALLED_APPS, you need to add one new variable to your settings.py with the canonical URL you want to claim ownership for. Port, protocol and subdomain must be an exact match.

DJ_HUMAN_JSON_URL = "https://www.screamingatmyscreen.com"  # replace with your own domain!

Include the dj_human_json view in your projects urls.py. The path does not matter.

from django.contrib import admin
from django.urls import path

from dj_human_json.views import human_json

urlpatterns = [
    path("admin/", admin.site.urls),
    path("human.json", human_json, name="human.json"),
]

Last step is advertising human.json via link in the head section of your HTML template.

<html lang="en">

<head>
    <link rel="human-json" href="/human.json" />
</head>

You likely want to use the URL template tag and not be lazy as I am in this example.

Vouching for sites

Go to Djangos admin interface and create a new entry in the Vouch table or create vouches via shell.

Vouch.objects.create(url="https://www.screamingatmyscreen.com")

CI status

The public repository shows the CI as waiting which is a result of the repository being a push mirror and the actual CI running on our internal Forgejo instance. Releases are tested, pinky promise.