Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions hamlpy/hamlpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down