Django Placehold.it
A fully featured drop-in replacement of placehold.it for Django
Features
- Everything placehold.it and placeholder.com did
- Identical URL structure
- Improved font rendition and vertical text alignment
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 to86400 * 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 toNone
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)
| File | Size | Uploaded | |
|---|---|---|---|
| django_placeholdit-1.1.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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