Skip to content

sheepman4267/django-srcdoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-srcdoc

PyPI - Version PyPI - Python Version


Table of Contents

Installation

  1. Install django-srcdoc from PyPI:

    pip install django-srcdoc
  2. Add django-srcdoc to INSTALLED_APPS in your settings.py:

    INSTALLED_APPS = [
       # ...
       'django_srcdoc',
       # ...
    ]

Usage

After installation, use the {% srcdoc %} tag much like the {% filter %} tag. A brief example:

<iframe srcdoc="{% srcdoc %}{{ some_html_from_your_project }}{% endsrcdoc %}"></iframe>

HTML to be escaped could be written by hand, passed in as a variable, or added with an {% include %} tag (or any other method you like).

The tag will escape HTML per the iframe specification.

License

django-srcdoc is distributed under the terms of the MIT license.

About

A simple Django template tag to automate escaping HTML for use with the iframe srcdoc attribute.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages