Skip to main content

High-flying components for perfectionists with deadlines

Project description

django-bird

PyPI PyPI - Python Version Django Version

High-flying components for perfectionists with deadlines.

[!CAUTION] This is an experimental, pre-alpha attempt at a different approach to defining components in Django templates. It is not suitable for production use yet.

Requirements

  • Python 3.10, 3.11, 3.12, 3.13
  • Django 4.2, 5.0, 5.1

Installation

  1. Install the package from PyPI:

    python -m pip install django-bird
    
    # or if you like the new hotness
    
    uv add django-bird
    uv sync
    
  2. Add the app to your Django project's INSTALLED_APPS:

    INSTALLED_APPS = [
        ...,
        "django_bird",
        ...,
    ]
    
  3. django-bird requires two settings in your settings.TEMPLATES to be configured to work properly:

    • django_bird.templatetags.django_bird in the builtins
    • django_bird.loader.BirdLoader in the innermost list of loaders, before django.template.loaders.filesystem.Loader and django.template.loaders.app_directories.Loader

    By default, these should be configured for you automatically. If you would like to disable this behavior and set this up yourself, you will need to set DJANGO_BIRD["ENABLE_AUTO_CONFIG"] = False.

    # settings.py
    from pathlib import Path
    
    
    DJANGO_BIRD = {
        "ENABLE_AUTO_CONFIG": False,
    }
    
    TEMPLATES = [
        {
            "BACKEND": "django.template.backends.django.DjangoTemplates",
            "DIRS": [
                Path(__file__).parent / "templates",
            ],
            "OPTIONS": {
                "builtins": [
                    "django_bird.templatetags.django_bird",
                ],
                "loaders": [
                    (
                        "django.template.loaders.cached.Loader",
                        [
                            "django_bird.loader.BirdLoader",
                            "django.template.loaders.filesystem.Loader",
                            "django.template.loaders.app_directories.Loader",
                        ],
                    ),
                ],
            },
        }
    ]
    

Getting Started

Coming soon...

Documentation

Please refer to the documentation for more information.

License

django-bird is licensed under the MIT license. See the LICENSE file for more information.

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_bird-0.1.0a1.tar.gz (86.6 kB view hashes)

Uploaded Source

Built Distribution

django_bird-0.1.0a1-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page