Metadata-Version: 2.4
Name: django-human-json
Version: 0.1.0
Summary: Implements human.json as Django application.
Project-URL: Homepage, https://source.rdctd.de/timo/django-human-json
Author-email: Timo Zimmermann <timo@screamingatmyscreen.com>
License: MIT
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 6.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Requires-Dist: django>=4.2
Description-Content-Type: text/markdown

# Django Human.json
This package implements the [human.json][1] 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.

```shell
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.

```python
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.

```python
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
<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.

```python
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.

[1]: https://codeberg.org/robida/human.json
