It's not about "crashing" the templating engine, but more ensuring that all variables defined in the template are filled.
What I wan't to do is to create applications configuration files from a template. It's not a web-related project at all, but since I find Django so well done, I was trying to use it for something it was not conceived to perform. I found Cheetah fits more my needs for what I intend to do. Thanks for your quick replies. Guillaume Le mercredi 26 juillet 2006 17:26, Bill de hÓra a écrit : > I'd assumed you were define variable values in one place and passing > them into a template to generate your configuration files from the view. > As an approach to verification, crashing the templating engine doesn't > seem necessary, but I don't understand your setup. > > cheers > Bill > > Guillaume Pratte wrote: > > To verify the variables before passing control to the template system is > > not a viable solution, and would break the DRY principle (Don't Repeate > > Yourself). I would have to know what variables are defined in my > > templates in my code calling the template, thus duplicating the > > information and rendering my code harder to maintain. > > > > Guillaume > > > > Le mercredi 26 juillet 2006 14:10, Bill de hÓra a écrit : > >> I'd say verify the variable set in the view before you emit and fail at > >> that point. Failing at the template allows designers to break sites. > >> > >> Guillaume Pratte wrote: > >>> In http://www.djangoproject.com/documentation/templates_python/ you can > >>> read : > >>> > >>> In Django 0.91, if a variable doesn't exist, the template system > >>> fails silently. The variable is replaced with an empty string. > >>> > >>> This is controlled with the silent_variable_failure variable set to > >>> True in the ObjectDoesNotExists exception. > >>> > >>> I would like to use Django's templating system to generate > >>> configuration files from a template. Thus, I would like Django to > >>> inform me (raise an exception) if a variable if not found instead of > >>> failing silently. > >>> > >>> Is this possible? It does not seems so with the current code. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---

