https://github.com/unplugstudio/django-alttext
Alt text for files in Django
https://github.com/unplugstudio/django-alttext
Last synced: over 1 year ago
JSON representation
Alt text for files in Django
- Host: GitHub
- URL: https://github.com/unplugstudio/django-alttext
- Owner: unplugstudio
- License: mit
- Created: 2019-07-03T18:41:48.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-24T22:22:33.000Z (over 3 years ago)
- Last Synced: 2025-02-20T07:48:24.612Z (over 1 year ago)
- Language: Python
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Django Alt Text
===============
Generic alt text model associated to files by their path.
Install
-------
1. Install via pip: ``pip install django-alttext``.
2. Add ``alttext`` to your ``INSTALLED_APPS``.
3. Run migrations.
4. Optionally follow the integration instructions that apply to your case.
Usage
-----
Using one of the supported integrations staff users will be able to add alt text for images in the admin interface. The app stores a list of alt texts by their associated image path.
In your templates, you can now access the alt text for any file using the ``alttext`` filter:
.. code::
{% load alttext_tags %}

Mezzanine integration
---------------------
If you're using Mezzanine and filebrowser-safe, add ``alttext.mezzanine`` to your INSTALLED_APPS before ``mezzanine.boot`` to enable alt-text links in the admin. A link to "Edit alt text" will appear next to each ``FileField`` in Add and Change forms.
Configuration
-------------
- Enable the admin list view to manage all AltText instances: ``settings.ALTTEXT_ADMIN_DISPLAY = True``.
Contributing
------------
Review contribution guidelines at CONTRIBUTING.md_.
.. _CONTRIBUTING.md: CONTRIBUTING.md