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.4.tar.gz (5.6 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.4-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: django-alttext-1.0.4.tar.gz
  • Upload date:
  • Size: 5.6 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.4.tar.gz
Algorithm Hash digest
SHA256 d8d20a09e9910b43644dc36001c8a933d6344f9038304088034aa7208954d19b
MD5 37341508cb871c22ec665b9da4252c79
BLAKE2b-256 ea469a79e65fb6ac808bc0e4fbd5c0878551880df197ff02e4f3844419b99be4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_alttext-1.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.8 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.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 24e9c2b0c7aa07ea06fb4524662b45438abc9e9831365971fc24e00766191074
MD5 3e458d1b6718ef8eb1d05efc95fe963d
BLAKE2b-256 f087890705ad1eb7f13a3d781bfa8b843a16d3091d962499d7c77143c516390d

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