django-admin-fk-links
Reusable Django admin mixin that turns ForeignKey fields into direct clickable links to their related admin change views.
✨ Features
- ✅ Converts
ForeignKeyfields into clickable links inlist_display - ✅ Works with the default Django admin and custom
AdminSite - ✅ Zero configuration
- ✅ No need to add to
INSTALLED_APPS - ✅ Fully compatible with Django 2.2+
📦 Installation
pip install django-admin-fk-links
🚀 Quick Usage
from django.contrib import admin
from django_admin_fk_links import ForeignKeyLinkMixin
@admin.register(Book)
class BookAdmin(ForeignKeyLinkMixin, admin.ModelAdmin):
list_display = ("title", "author")
list_display_foreign_key_links = ("author",)
That’s it. The author column will now be a direct link to its admin change view.
🖼️ Screenshots
Before — author rendered as plain text:
After — author rendered as a clickable link to its change view:
⚙️ How It Works
The mixin dynamically replaces the fields listed in:
list_display_foreign_key_links = ("field_name",)
with callables that render an <a> tag pointing to the related object’s admin change view.
It also supports:
- Sorting via admin_order_field
- Automatic verbose_name resolution
- Custom AdminSite namespaces
✅ Compatibility
- Django 2.2+
- Python 3.7+
- Default admin.site ✅
- Custom AdminSite(name="custom") ✅
🪪 License
This project is licensed under the MIT License.
🤝 Contributing
Contributions, issues and feature requests are welcome. Feel free to open a PR or issue.
⭐ If you find it useful
Please consider giving the project a ⭐ on GitHub — it really helps!
Metadata
Release files for django-admin-fk-links 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_admin_fk_links-0.1.2.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_admin_fk_links-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.6 kB
Release files / django_admin_fk_links-0.1.2.tar.gz
| Download URL | django_admin_fk_links-0.1.2.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
233695a1a6f460204e7de6588f180413c583b9dab9697462bb76c4b4cf540677
|
|
BLAKE2b-256 checksum How to use checksums |
03883b826221e0ccd57fba236718f281bcf4d0d1e61ecdad2823c70893d14463
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency logRelease files / django_admin_fk_links-0.1.2-py3-none-any.whl
| Download URL | django_admin_fk_links-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08ce20b1ce19def9803e66e5f615e4de6efe9a93f55ec2ef4ab2a734965d143b
|
|
BLAKE2b-256 checksum How to use checksums |
bee0e7549672a961a3f925f5b7780db926ba4a1c214db6189d293045bb7b2d49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency log