Skip to main content

Django Placehold.it

PyPI CI Coverage Downloads License

A fully featured drop-in replacement of placehold.it for Django


Features

Install

pip install django-placeholdit

Add django_placeholdit to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = [
    # ...
    "django_placeholdit",
]

Add the routes into your urls.py, feel free to customise the prefix or namespace, no trailing slash:

urlpatterns = [
    # ...
    path("placeholders/", include("django_placeholdit.urls", namespace="placeholdit")),
]

Configuration

The following options can be configured in your settings.py:

  • PLACEHOLDIT_CACHE_SECONDS — Number of seconds to cache placeholders. Defaults to 86400 * 7 (a week)
  • PLACEHOLDIT_FONT_PATH — Font path that locates the font to be used, e.g. /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc. Defaults to None

Usage

In templates:

<img src="{% url 'placeholdit:placeholder' width=160 %}">
<img src="{% url 'placeholdit:placeholder' width=240 height=160 text='Custom dimensions' %}">
<img src="{% url 'placeholdit:placeholder' width=160 text='Custom text!' %}">
<img src="{% url 'placeholdit:placeholder' width=160 background='F77A00' color='fff' text='Custom colors!' %}">
<img src="{% url 'placeholdit:placeholder' width=240 height=80 background='fbd206' color='fff' text='Automatically' %}">
<img src="{% url 'placeholdit:placeholder' width=240 height=80 background='fbd206' color='fff' text='scaled!' %}">
<img src="{% url 'placeholdit:placeholder' width=160 background='93C663' color='3F740E' text='gif/jpeg/png' format='jpg' %}">

Resulting in:

<img src="http://example.com/placeholders/160">
<img src="http://example.com/placeholders/240x160&text=Custom%20dimensions">
<img src="http://example.com/placeholders/160&text=Custom%20text%21">
<img src="http://example.com/placeholders/160/F77A00/fff&text=Custom%20colors%21">
<img src="http://example.com/placeholders/240x80/fbd206/fff&text=Automatically">
<img src="http://example.com/placeholders/240x80/fbd206/fff&text=scaled%21">
<img src="http://example.com/placeholders/160.jpg/93C663/3F740E&text=gif/jpeg/png">

Development

poetry install
poetry run pytest
poetry run ruff check .

License

MIT

Metadata

Release files for django-placeholdit 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-placeholdit 1.1.0
File Size Uploaded
django_placeholdit-1.1.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-placeholdit 1.1.0
File Interpreter ABI Platform
django_placeholdit-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / django_placeholdit-1.1.0.tar.gz

Download URL django_placeholdit-1.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aa3c2002534237a514a72fe9bca65fde4a4b7cd900eb3dde159b7801ecdf3dcf
BLAKE2b-256 checksum
How to use checksums
c5389739c2abd61c9542256474c023d393ad0da61e314f5a1e1b6683c4517c86
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 Aug 27, 2026.

Transparency log

Release files / django_placeholdit-1.1.0-py3-none-any.whl

Download URL django_placeholdit-1.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3f4361e01e3462707dfe5a5d63dd1c6eb6dde717a00e7fce6f51b182deda79d
BLAKE2b-256 checksum
How to use checksums
b97156f93c81858c5f1673dd8a06c6079e67d7091edf2cc69ea5181631922a12
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 Aug 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.2

1 release file

1.0.1

1 release file

1.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page