diff --git a/hamlpy/hamlpy.py b/hamlpy/hamlpy.py index 4aa5037..cd7c452 100755 --- a/hamlpy/hamlpy.py +++ b/hamlpy/hamlpy.py @@ -4,6 +4,13 @@ import sys VALID_EXTENSIONS=['haml', 'hamlpy'] +try: + from django.conf import settings +except ImportError, e: + pass +else: + if hasattr(settings, 'HAMLPY_VALID_EXTENSIONS'): + VALID_EXTENSIONS.extend(settings.HAMLPY_VALID_EXTENSIONS) class Compiler: diff --git a/readme.md b/readme.md index f3b3664..1736a9b 100644 --- a/readme.md +++ b/readme.md @@ -91,6 +91,7 @@ For caching, just add `django.template.loaders.cached.Loader` to your TEMPLATE_L Following values in Django settings affect haml processing: * `HAMLPY_ATTR_WRAPPER` -- The character that should wrap element attributes. This defaults to ' (an apostrophe). + * `HAMLPY_VALID_EXTENSIONS` -- A list of additional file extensions that are loaded/watched by HamlPy. By default, HamlPy monitors files with `.haml` and `.hamlpy` extensions. ### Option 2: Watcher