Skip to main content

Custom template tags for using prefab-cloud-python in Django applications

Project description

prefab-cloud-django

This project provides custom template tags for using prefab-cloud-python in Django applications

Usage

  1. Add this project to your Django application's dependencies
  2. Add prefab_cloud_django to the list of INSTALLED_APPS in your app's settings.py
  3. Configure your Prefab client in settings.py
options = prefab.Options(
    api_key="...",
    ...
    log_boundary=BASE_DIR,
)

PREFAB = prefab.Client(options)
LOGGER = PREFAB.logger
  1. In your templates, add {% load prefab_tags %}

  2. Use these tags

{% prefab_get "name-of-config" %}
{% prefab_enabled "name-of-flag" %}

# with default

{% prefab_get "name-of-config" default="default" %}

# with context

{% prefab_get "name-of-config" context=context %}

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

prefab_cloud_django-0.2.0.tar.gz (1.8 kB view hashes)

Uploaded Source

Built Distribution

prefab_cloud_django-0.2.0-py3-none-any.whl (2.2 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