Skip to main content

django-fancybox

https://badge.fury.io/py/django-fancybox.svg https://img.shields.io/pypi/pyversions/django-fancybox.svg https://img.shields.io/pypi/djversions/django-fancybox.svg https://github.com/bashu/django-fancybox/actions/workflows/test.yml/badge.svg

This is a Django integration of Fancybox.

Installation

First install the module, preferably in a virtual environment. It can be installed from PyPI:

pip install django-fancybox

External dependencies

  • jQuery - This is not included in the package since it is expected that in most scenarios this would already be available.

Setup

Add fancybox to INSTALLED_APPS:

INSTALLED_APPS += (
    'fancybox',
)

Be sure you have the django.template.context_processors.request processor

TEMPLATES = [
    {
        ...
        'OPTIONS': {
            'context_processors': [
                ...
                'django.template.context_processors.request',
            ],
        },
    },
]

and just include fancybox templates

{% include "fancybox/fancybox_css.html" %} {# Before the closing head tag #}
{% include "fancybox/fancybox_js.html" %} {# Before the closing body tag #}

When deploying on production server, don’t forget to run :

python manage.py collectstatic

Usage

Extend base template for ajax requests

{% extends request.headers.x_requested_with|yesno:"fancybox/base.html,base.html" %}

Add class="fancybox" to a link, and set the href to a page you want to display

<a data-fancybox data-type="ajax" href="{% url 'remote.html' %}" class="fancybox">Click here</a>

Please see example application. This application is used to manually test the functionalities of this package. This also serves as a good example.

Contributing

If you like this module, forked it, or would like to improve it, please let us know! Pull requests are welcome too. :-)

License

django-fancybox is released under the BSD license.

Changes

0.2.0 (2026-11-13)

  • Build the package with hatchling instead of setuptools.

  • Move the package to the src layout; tests are no longer shipped in the distribution.

  • Simplify the example project: it runs with uv and needs no database.

  • Detect ajax requests in templates with request.headers.x_requested_with instead of request.is_ajax, which was removed in Django 4.0. Update your templates the same way.

0.1.9 (2026-10-10)

  • Drop Python 3.10 support; Python 3.11 is now the minimum required version.

0.1.7 (2026-08-14)

  • Migrate packaging to pyproject.toml and modern tooling (ruff, pre-commit, tox, versionflow).

Metadata

Release files for django-fancybox 0.2.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-fancybox 0.2.0
File Size Uploaded Provenance Actions
django_fancybox-0.2.0.tar.gz 32.7 kB With provenance Details for django_fancybox-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-fancybox 0.2.0
File Interpreter ABI Platform Actions
django_fancybox-0.2.0-py3-none-any.whl Python 3 none any Details for django_fancybox-0.2.0-py3-none-any.whl

Total release size: 63.1 kB

Release files / django_fancybox-0.2.0.tar.gz

Download URL django_fancybox-0.2.0.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2251ed74f418f3423b6793c3784a194940404d0909cabc79d5baa1e742e0ec1a
BLAKE2b-256 checksum
How to use checksums
5e2eecd77d4518a80fb136a53a93860b6e177d4e74d8a4525b7a687cabf55b3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 13, 2026.

Transparency log

Release files / django_fancybox-0.2.0-py3-none-any.whl

Download URL django_fancybox-0.2.0-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
819a9b3d1f0b2971891e198e7daf2aed01fa23ec31a70ddf31c1acdd7a7b35a0
BLAKE2b-256 checksum
How to use checksums
68c2aa11974b256af8a2307c1dcc97ab74dbbad303928a2a278d56ee2f8ad530
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 13, 2026.

Transparency log

Security for django-fancybox 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_fancybox-0.2.0.tar.gz

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 Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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