Skip to content

Commit

Permalink
Add a getenv template tag
Browse files Browse the repository at this point in the history
  • Loading branch information
darkpixel committed Sep 22, 2014
1 parent c533a88 commit 3a69755
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Empty file added getenv/templatetags/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions getenv/templatetags/getenv.py
@@ -0,0 +1,12 @@
from django import template
from .. import env


register = template.Library()
@register.simple_tag(name="getenv")
def getenv(envvar):

""" Return an environment variable for use in a template. """

return env(envvar)

0 comments on commit 3a69755

Please sign in to comment.