wagtail-links
Purpose
Wagtail links has two goals:
- Provide a consistent way to refer to links, which may be of different types, so as to reduce decision fatigue
- Minimize broken links as much as possible.
Install
Install wagtail-links via Pip.
pip install wagtail-links
Add wagtail_links to your Django project's INSTALLED_APPS setting.
Run database migrations.
python manage.py migrate
Usage
Add a foreign key to the page you wish to add links to.
my_link = models.ForeignKey(
'wagtail_links.Link',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)
Neat:
You may use it like:
<a href="{{ self.link.url }}">Link here</a>
From a template, you can also load a link by its name:
{% load get_wagtail_link_url from wagtail_links %}
<a href="{% get_wagtail_link_url 'my-link' %}">Link here</a>
This is useful for global page links, navigation, etc.
Searching links
Every field on a Link is searchable, both in the Snippets area and in the
link choosers: title, name, link_external, link_relative,
django_view_name, and the linked page's title. Each field is indexed as both
a full-text SearchField and an AutocompleteField (type-ahead).
The resolved URL is also indexed via the search_url property, which replaces
separators with spaces so full-text backends can match individual host/path
segments (e.g. 2022 in .../2022/...) — something they can't do against a
raw URL, which Postgres indexes as one opaque token.
Upgrading from an earlier version only changes what gets written to the search
index going forward; links already stored stay indexed under the old field set
until re-indexed. Run python manage.py update_index to rebuild the index so
existing links pick up the expanded searchable fields.
Validation and logging
The Link model will validate that one and only one field is set. It will also disallow invalid Django reverse view names.
If a URL cannot be determined, we'll log the issue as a warning. We won't throw an exception as that would be bad for users. You are responsible for capturing this log warning, perhaps using Sentry.
For example - let's say you make a Django view name called admin:index. This would typically give you /admin/. Later the admin application is removed from the program, now this link fails. It will now display "" and generate a warning in your server logs.
Metadata
Release files for wagtail-links 2.12.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| wagtail_links-2.12.0.tar.gz | 80.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wagtail_links-2.12.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 97.3 kB
Release files / wagtail_links-2.12.0.tar.gz
| Download URL | wagtail_links-2.12.0.tar.gz |
|---|---|
| Size | 80.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d800f36214ff4ca27608dc42115be56bfdb360f891ea6413e81896faaa393615
|
|
BLAKE2b-256 checksum How to use checksums |
bbf1a7801bdb39f3f705fc7dde6f9d6376895f93a07f2276f656af32bc6420e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitLab CI/CD, verified by PyPI on Jul 16, 2026.
Transparency logRelease files / wagtail_links-2.12.0-py3-none-any.whl
| Download URL | wagtail_links-2.12.0-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eac3cc0e93e6024b4681c0a81c03e28ced4248133fd9b4083614f203bfa0b783
|
|
BLAKE2b-256 checksum How to use checksums |
d6143d9243d084dbe4a88a7e05b9de99e2e8c68d0b1d74d643860441d582e635
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitLab CI/CD, verified by PyPI on Jul 16, 2026.
Transparency logSecurity for wagtail-links 2.12.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for wagtail_links-2.12.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitLab CI/CD, verified by PyPI on Jul 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.