Open DamnedScholar opened 3 years ago
This might also work as a solution -> http://niwinz.github.io/django-jinja/latest/
@jonathan-s I use that package and I'm not sure how. The package implements a default config and some Django-like tags, but it doesn't change the piece that breaks: the load
tag is invalid because Jinja uses a different loading paradigm. You could force Jinja to ignore that tag and not throw an error, but working around a problem by patching the syntax for me alone sounds like it would smell terrible. No, the ideal solution is to have a set of Jinja-compatible scaffold templates, which would be easy for a Jinja-user to provide on their own if sockpuppet
had a command to scaffold its own templates (and I shall, having done it manually).
So the question is whether it's suitable to provide Jinja templates in this general purpose package. I would argue that it is, since Django ships with an optional Jinja backend and the maintenance burden for another set of templates here is almost nothing. I can PR them here or publish a helper/component library for the other heretics.
I wouldn't mind a PR if you want to make one.
Bug Report
Describe the bug
When you run
generate_reflex
, the boilerplate template gets run through the Django template engine in order to create an appropriately named generichtml
file. If you have disabled the default Django templating in favor of Jinja, it will throw a syntax exception and catch fire, but not before thereflexes
directory is created. Thetemplates
andjavascript
directories get blocked completely.https://puu.sh/H7yV2/8c3a713720.png
Expected behavior
Thoughts
Obviously the solution to my problem is to override the templates with proper Jinja syntax, which I am doing. That will nullify the errors encountered above, but won't fix the hole in the pipeline, so I will also look into patching the management command. There will definitely be a graceful shutdown with informative error message in the case of this particular problem, and I will likely submit a follow-on PR with a Jinja-compatible template set and backend autodetection.
Very low priority. If you're doing advanced enough shit to run into this, you're going to be able to work around it like I am.