django - Why does using a variable in settings.ALLOWED_INCLUDE_ROOTS won't let me use {% ssi %}? -
problem
i'm using django 1.3. have use many different javascript functions (like 10 or something) in template.
what first did put them in <script> tag, worked fine. works, want separate them template code. make code way more read'able.
so thought of using {% ssi "..." parsed %} thing. since use django template tags in javascript code, can't link them static files <script src="..."></script>.
here works :
# allow {% ssi %} tag include files given paths allowed_include_roots = ( '/this/is/the/full/path/to/my/project/static/js/', ) here not work :
# project root further paths project_path = os.path.dirname(__file__) # allow {% ssi %} tag include files given paths allowed_include_roots = ( project_path+'/static/js/', ) i double-checked 2 strings same (with ./manage shell) , same (with trailing / , all).
questions
- why second code renders me
[didn't have permission include file]in template ? - also, how should link file include in
{% ssi %}tag ? since{% get_static_prefix %}not work, i'm using file's full path, ugly.
as odd may appear, didn't make change in settings.py functionnal. believe mike cooper right , remote code breaking allowed_include_roots path.
Comments
Post a Comment