Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{% include %} template tags do not work with non-VALID_EXTENSIONS #121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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