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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: django-alttext-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4cb7efd52062ec484407ca6ff655a10c656df2576e5b4b4fe415120a1f2e485c
MD5 bd8009b323f9d51f5c9e391e22154808
BLAKE2b-256 157a11a0d1ca6cb805fcf99ae267ab5c9fd4212739eb3a0b7665e43ee6ac32f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_alttext-1.0.3-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.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 50ee3ca97db81ce42bfe55c8e8c631e16036083c90bbf110b94fec96a63bc71a
MD5 b757d348073daaf223119ccb8f3b9449
BLAKE2b-256 5cc7a03ffdb8e0ef7703fc33fa44db69ce327ec11448cfd45d96a0698c733126

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