Skip to main content

Add alt text to images

Project description

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:

{% load alttext_tags %}
<img src="{{ mymodel.imagefield }}" alt="{{ mymodel.imagefield|alttext }}" >

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-alttext-1.0.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_alttext-1.0.2-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-alttext-1.0.2.tar.gz.

File metadata

  • Download URL: django-alttext-1.0.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/2.7.14

File hashes

Hashes for django-alttext-1.0.2.tar.gz
Algorithm Hash digest
SHA256 59cba6a88d8b423466dd05cdc2cb15a2dff3066ef75952bbec1fb46e4f387de0
MD5 bbc7997e11167bc9300b3168a239c6f9
BLAKE2b-256 d6548c12687e0a808fdbe6d324628a545917664b84033a87198576fdbc4b40b3

See more details on using hashes here.

File details

Details for the file django_alttext-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: django_alttext-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/2.7.14

File hashes

Hashes for django_alttext-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 936953bf8b17a8567d67a6ca8831b70c1b20c0fe8125e6e6fce0d7274f3d679a
MD5 a833f7b0942614d85931ef2b4a61fbdc
BLAKE2b-256 dfff480e5cd3384e5d1092c1d0fe7bc53928e9c72061875ee9eec24b53ce6ae8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page