Metadata-Version: 1.1
Name: django-tagconstants
Version: 0.1
Summary: Define constants in your settings, and make them available in your templates.
Home-page: https://github.com/nalourie/django-tagconstants
Author: Nick Lourie
Author-email: developer@nicholaslourie.com
License: MIT License
Description: django-tagconstants
        ===================
        
        Define constants in your settings file, that are then made available in
        your templates.
        
        Installation
        ============
        
        From the command line:
        
        ::
        
            pip install django-tagconstants
        
        Add tagconstants to your installed apps:
        
        .. code:: python
        
            INSTALLED_APPS = (
                ...
                'tagconstants',
                ...
            )
        
        Create a ``TAG_CONSTANTS`` dictionary in your ``settings.py`` file:
        
        .. code:: python
        
            TAG_CONSTANTS = {}
        
        Usage
        =====
        
        For security purposes, ``tagconstants`` is designed so that you create a
        whitelist of variables to make available in your templates. For more
        information see the **Design and Security** section.
        
        To use a constant in your templates, first add the constant to your
        ``TAG_CONSTANTS`` setting:
        
        .. code:: python
        
            TAG_CONSTANTS = {
                'CONSTANT': 'SOME STRING',
            }
        
        Then in your templates, you can recall these constants with the
        ``{% constant ... %}`` template tag:
        
        .. code:: html
        
            {% load tagconstants %}
        
            {% constant "CONSTANT" %}
                {# renders to 'SOME STRING' #}
        
            {% constant "CONSTANT" as "variable_name" %}
                {# loads the template variable variable_name="SOME STRING" #}
                {# into the template context #}
        
        Contributing
        ============
        
        Pull, fork, do whatever you'd like with the code.
        
Keywords: django constants templates settings templatetags
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
