django template engine and bootstrap modals

2022-02-10 Thread Andrea Villani
Hi everyone! I am developing an appweb and I'm stuck. My homepage is structured as a ListView, where each row shows every object's attributes using django template engine (ex: {{object.attribute}}. Last column shows a button to do an action through a bootstrap modal and if I pu

Re: 'Sandboxed' Template engine/context

2020-08-13 Thread Mitesh Shah
traightforward way to create an independent > template engine instance with a subset of the tags/filters/etc. defined? > > The use-case is for allowing user-supplied template content, while > preventing said users from being able to use features that could be > dangerous

Re: 'Sandboxed' Template engine/context

2020-07-11 Thread Integr@te System
Hope these useful. On Sat, Jul 11, 2020, 12:25 PM Michael Thomas wrote: > Hi, > > I'm aware that other template engines could be used, but it would be much > more preferable to stick with Django's template engine for a variety of > reasons (eg. using the same tags in th

Re: 'Sandboxed' Template engine/context

2020-07-10 Thread Michael Thomas
Hi, I'm aware that other template engines could be used, but it would be much more preferable to stick with Django's template engine for a variety of reasons (eg. using the same tags in the 'sandboxed' environment vs. regular). On Friday, 10 July 2020 14:41:30 UTC+4, In

Re: 'Sandboxed' Template engine/context

2020-07-10 Thread Integr@te System
Hi Michael, Some templates as mako, jinja, genshi... On Fri, Jul 10, 2020, 4:23 PM Michael Thomas wrote: > Hi all, > > Does anyone know of a straightforward way to create an independent > template engine instance with a subset of the tags/filters/etc. defined? > > T

'Sandboxed' Template engine/context

2020-07-10 Thread Michael Thomas
Hi all, Does anyone know of a straightforward way to create an independent template engine instance with a subset of the tags/filters/etc. defined? The use-case is for allowing user-supplied template content, while preventing said users from being able to use features that could be dangerous

Announcing native Chameleon template engine support in Django

2013-11-08 Thread Kevin
Hello Django users! Today I sat down and wrote a native template Loader for Chameleon support in Django. For those not familiar with this template engine, it was used in the previously infamous Zope and later Plone web frameworks. It uses mostly XHTML formatting and documentation

Re: question about template engine jinja

2011-08-14 Thread Phang Mulianto
i read the doc , just in time compilation to Python bytecode is used in > jinja.. > > > > is django default template also do this ? > > > > which i see the reason why jinja faster. > > Django's template engine doesn't currently bytecode compilation; however

Re: question about template engine jinja

2011-08-14 Thread Russell Keith-Magee
On Sunday, August 14, 2011, Phang Mulianto wrote: > Thanks Reinout for the response, > > i read the doc , just in time compilation to Python bytecode is used in jinja.. > > is django default template also do this ? > > which i see the reason why jinja faster. Django'

Re: question about template engine jinja

2011-08-13 Thread Phang Mulianto
ang Mulianto wrote: > >> and i read about jinja template, why it can be faster than django >> template engine ? >> > > Jinja basically uses django's syntax, but (if my memory is correct) it > allows you to do more things than django's templates allows you to. &g

Re: question about template engine jinja

2011-08-13 Thread Reinout van Rees
On 13-08-11 14:41, Phang Mulianto wrote: and i read about jinja template, why it can be faster than django template engine ? Jinja basically uses django's syntax, but (if my memory is correct) it allows you to do more things than django's templates allows you to. Is it faster?

question about template engine jinja

2011-08-13 Thread Phang Mulianto
Hi all, i need sugestion about templating. if i use many include in django template, is it a good practice and effect the load performance of the application ? and i read about jinja template, why it can be faster than django template engine ? how many of you prefer jinja, and why ? thanks

Re: how safe is the template engine

2010-10-18 Thread Brendan Smith
but that would of > course preclude your users from using *any* HTML. > > On Oct 16, 12:06 pm, "Henrik Genssen" > wrote: > > Hi, > > > > can I safely use the template engine to produce user configured output? > > If I use the template engine li

Re: how safe is the template engine

2010-10-18 Thread ringemup
ntext variable, and then load the result of that as a template, but that would of course preclude your users from using *any* HTML. On Oct 16, 12:06 pm, "Henrik Genssen" wrote: > Hi, > > can I safely use the template engine to produce user configured output? > If I use the templat

Re: how safe is the template engine

2010-10-18 Thread Jonathan S
Be careful, Don't forget that users will be able to execute random templatetags, which may be able to do read/write to the database as well. On 16 oct, 18:06, "Henrik Genssen" wrote: > Hi, > > can I safely use the template engine to produce user configured output?

how safe is the template engine

2010-10-16 Thread Henrik Genssen
Hi, can I safely use the template engine to produce user configured output? If I use the template engine like it is done in the RSSFeed: title_tmp = Template('{% load i18n %}' + userInput) ctx = Context({'dstart': date.dstart, where userInput is something a user can

Re: Django as a Template Engine?

2009-03-25 Thread bruno desthuilliers
On 24 mar, 19:33, Dave A wrote: > Hi, > > I'm new to Django -- I'm evaluating open source frameworks in an > attempt to port an existing application to a non-proprietary > platform. > I like Django, but am not sure about how to approach an application > templating function from the current system

Django as a Template Engine?

2009-03-24 Thread Dave A
Hi, I'm new to Django -- I'm evaluating open source frameworks in an attempt to port an existing application to a non-proprietary platform. I like Django, but am not sure about how to approach an application templating function from the current system... In short, each registered user of the sys

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-30 Thread Ulf Kronman
Hi again Malcolm, I've now performed some of the test you suggest here, and I would like to report my findings. > > It seems to me that when the Python renderer sees the Decimal() call, > > it goes and fetches my OS locale, which calls for Swedish decimal > > commas instead of US decimal points.

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-30 Thread Malcolm Tredinnick
On Sun, 2008-11-30 at 01:34 -0800, Ulf Kronman wrote: > Hi Malcolm, > > > I forgot to mention this in my last reply, but you didn't actually > > answer the question that Karen asked. If you open up a Python prompt on > > your machine and do this: > > > > >>> import decimal > > >>

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-30 Thread Ulf Kronman
Hi Malcolm, > I forgot to mention this in my last reply, but you didn't actually > answer the question that Karen asked. If you open up a Python prompt on > your machine and do this: > >         >>> import decimal >         >>> decimal.Decimal('1.0') > > does it raise an exception? Sorry, I forg

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-29 Thread Malcolm Tredinnick
Karen wrote.. > > does "Decimal('1.0')" on this > > machine raise that exception? On Sat, 2008-11-29 at 01:08 -0800, Ulf Kronman wrote: > > Yes, you are truly on to something there. Please look at my somewhat > confused report below. It seems as my pymssql call returning a longint > as a Dec

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-29 Thread Malcolm Tredinnick
On Sat, 2008-11-29 at 04:59 -0800, Ulf Kronman wrote: > Hi again, > a follow up: > > It seems as if it is a design decision from the pymsql developers to > return Decimal for BIGINT (sorry; not longint, as I said before). It > is documented here: > > http://freshmeat.net/projects/pymssql/?bran

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-29 Thread Malcolm Tredinnick
On Sat, 2008-11-29 at 00:37 -0800, Ulf Kronman wrote: > Hi, I'm back to report that I have found the cause and a temporarily > solution to my problem. > > First of all; thanks to Malcolm and Karen for trying to help me out, > even if I didn't give a lot of detail on the problem in the first > ro

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-29 Thread Ulf Kronman
Hi again, a follow up: It seems as if it is a design decision from the pymsql developers to return Decimal for BIGINT (sorry; not longint, as I said before). It is documented here: http://freshmeat.net/projects/pymssql/?branch_id=59462&release_id=205925 > big numbers (MONEY, SMALLMONEY, DECIMAL,

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-29 Thread Ulf Kronman
Hi Karen, > Are you running an SVN checkout and did you update it from something prior > to r9369/r9370 to something after that level right before this started > happening?   Yes, it may well be. Is there a place in TortoiseCVS where I can see a history of my updates? Looking at the log just sho

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-29 Thread Ulf Kronman
Hi, I'm back to report that I have found the cause and a temporarily solution to my problem. First of all; thanks to Malcolm and Karen for trying to help me out, even if I didn't give a lot of detail on the problem in the first round. The reason was that I was frustrated and tired late in the nig

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-25 Thread Ulf Kronman
Thanks Karen and Malcolm, I'll get back with a more thorough answer when I find more time. I just wanted to leave a short note that I have verified that the problem actually *is* somewhere in my view code. I have been able to run another view containing floatformat and get floats with decimal po

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-25 Thread Karen Tracey
ode the variable to a string with a comma delimiter it > passes without error: > flt_cy_average = '1,24' > > I'm running the code on Windows XP, Swedish version and the same code > is working on an Ubuntu server without any problems. Is the problem > that the templa

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-25 Thread Malcolm Tredinnick
On Tue, 2008-11-25 at 01:01 -0800, Ulf Kronman wrote: [...] > You also said that you could see some interesting behaviour on Apache, > and my (maybe stupid) question was meant to be if that somehow could > affect the Django template engine. The "template engine", as you keep

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-25 Thread Ulf Kronman
ttle tricky > > > to do so (it affects the locale for all threads in that process, which > > > could well lead to interesting behaviour on a multipthreaded Apache > > > setup, for example). > > > OK, but would that effect the Django template engine? > >

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-25 Thread Malcolm Tredinnick
all setlocale() itself and it would be a little tricky > > to do so (it affects the locale for all threads in that process, which > > could well lead to interesting behaviour on a multipthreaded Apache > > setup, for example). > > OK, but would that effect the Django templ

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-25 Thread Ulf Kronman
d float output to MS Excel, but have commented away that code as far as I can see.) Do you happen to know if there was some changes made to the template engine at the end of last week? As I told you, I tried to revert the Django version from the CVS, but the problem prevails. > Django doesn

Re: Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-24 Thread Malcolm Tredinnick
ariable to a string with a comma delimiter it > passes without error: > flt_cy_average = '1,24' > > I'm running the code on Windows XP, Swedish version and the same code > is working on an Ubuntu server without any problems. Is the problem > that the template engine is picking

Template engine reads OS locale (?) and expects comma instead of decimal point in floatformat

2008-11-24 Thread Ulf Kronman
wedish version and the same code is working on an Ubuntu server without any problems. Is the problem that the template engine is picking up my Swedish locale and how do I change this. I'm running Django revision 9526 and mod_python through Apache 2.2. I've set: USE_I18N = False and tried: im

Re: Template engine

2008-06-13 Thread Scott Moonen
Would it be possible to borrow from the embedded ruby syntax and define something like this: {{ variable.name -}} {% tag param1,param2 -%} If the '-' was present as part of the tag closure token, the template processor would eat the next 1-2 characters only if they were a CR or CR/LF. Although I

Re: Template engine

2008-06-13 Thread Norman Harman
Russell Keith-Magee wrote: > If there is a particular whitespace-eating behaviour that you would > like, you could always implement it yourself in a template tag. If you > think the template tag could be useful for others, you can share it on > djangosnippets.org, or open a ticket to have the tag

Re: Template engine

2008-06-13 Thread titaniumlou
Is this white-space behavior the case with all template tags? Is it desirable for all template tags? Maybe only tags that are common to be at the top of a template file could have this enhancement to erase whitespace between them and the next real tag in the template? It seems to me that if cer

Re: Template engine

2008-06-13 Thread Russell Keith-Magee
On Fri, Jun 13, 2008 at 11:58 PM, Arien <[EMAIL PROTECTED]> wrote: > > On Fri, Jun 13, 2008 at 9:48 AM, Norman Harman <[EMAIL PROTECTED]> wrote: >> Template's white space handling is one of the few things that irks me >> about Django. I hate having to make confusing formating, jamming stuff >> al

Re: Template engine

2008-06-13 Thread Arien
On Fri, Jun 13, 2008 at 9:48 AM, Norman Harman <[EMAIL PROTECTED]> wrote: > Template's white space handling is one of the few things that irks me > about Django. I hate having to make confusing formating, jamming stuff > all on the same line just to get white space correct. > > I really wish it h

Re: Template engine

2008-06-13 Thread Norman Harman
Juanjo Conti wrote: > Hi, I am using Django's template engine to produce rtf files and I > have noticed something: if the first line of my template is a {%load > ... %} tag then the result has a withe like at the to of it. This is > not a problem in html, the common use of th

Re: Template engine

2008-06-12 Thread Jeff Anderson
Juanjo Conti wrote: Hi, I am using Django's template engine to produce rtf files and I have noticed something: if the first line of my template is a {%load ... %} tag then the result has a withe like at the to of it. This is not a problem in html, the common use of the tempalte engine, b

Template engine

2008-06-12 Thread Juanjo Conti
Hi, I am using Django's template engine to produce rtf files and I have noticed something: if the first line of my template is a {%load ... %} tag then the result has a withe like at the to of it. This is not a problem in html, the common use of the tempalte engine, but is fatal in a rtf fil

Re: What happened to the template engine in SVN?

2008-03-26 Thread Malcolm Tredinnick
ee that > for myself by designing a few, simple test cases. The biggest > surprise came not from the fact that Jinja was faster, but how much > slower the Django SVN template engine was compared to the Django 0.96 > engine. It's difficult to tell from your chart what &quo

What happened to the template engine in SVN?

2008-03-26 Thread Vincent Foley
e not from the fact that Jinja was faster, but how much slower the Django SVN template engine was compared to the Django 0.96 engine. I have posted the result as an Excel chart here: http://www.flickr.com/photos/[EMAIL PROTECTED]/2363195045/ Could anyone tell me if they have similar experiences wit

Re: Using Django Template Engine

2007-11-14 Thread Brot
Hello Malcolm, thank you for your reply. Sorry, that I explained my problem too bad. In the meantime I found the solution for my problem and It's really simple. And it's a embarrassing situation for me, because the solution is documented: http://www.djangoproject.com/documentation/templates_pytho

Re: Using Django Template Engine

2007-11-13 Thread Malcolm Tredinnick
On Mon, 2007-11-12 at 23:04 -0800, Brot wrote: > Hello, > > I found a code example for "Using Markup" in the django wiki: > http://code.djangoproject.com/wiki/UsingMarkup > I need a similar solution, but with the internal django template > library. Is there any solution for this requirement? >

Using Django Template Engine

2007-11-12 Thread Brot
Hello, I found a code example for "Using Markup" in the django wiki: http://code.djangoproject.com/wiki/UsingMarkup I need a similar solution, but with the internal django template library. Is there any solution for this requirement? I would like to store little html/template chunks in a databas

Re: De-Coupling and the template engine?

2006-03-07 Thread ChaosKCW
>Great minds think alike/Fools never differ :-) Check out: > http://code.djangoproject.com/ticket/1321 > Lol, yip. I agree whole heartedly with the premise of this ticket. The ORM and the Template Engine rock, and I have need of both outside a web framework. For my standalone app

Re: De-Coupling and the template engine?

2006-03-06 Thread Russell Keith-Magee
On 3/6/06, ChaosKCW <[EMAIL PROTECTED]> wrote: > This seems coupled to me ? Is there a way to use the template engine on > its own ? Or am just missing the obvious ? Great minds think alike/Fools never differ :-) Check out: http://code.djangoproject.com/ticket/1321 This came up

Re: De-Coupling and the template engine?

2006-03-06 Thread Daniel Ericsson
On 6 mar 2006, at 12.30, ChaosKCW wrote: > Hi > > One of the great design philosohies I love about Django is the > decoupling. However when trying to use the template engine on its own, > the import refers the django setttings module env variable, which turn > should point to a

De-Coupling and the template engine?

2006-03-06 Thread ChaosKCW
Hi One of the great design philosohies I love about Django is the decoupling. However when trying to use the template engine on its own, the import refers the django setttings module env variable, which turn should point to a settings.py which in turn is part of a project ? This seems coupled

Re: Template engine error?

2006-02-10 Thread limodou
On 2/10/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > On Friday 10 Feb 2006 2:38 pm, Tobias wrote: > > TemplateSyntaxError: Caught an exception while rendering. > > usualy templatesyntaxerror has nothing to do with templates - there > may be a syntax error in your model itself - a missing c

Re: Template engine error?

2006-02-10 Thread Kenneth Gonsalves
On Friday 10 Feb 2006 2:38 pm, Tobias wrote: > TemplateSyntaxError: Caught an exception while rendering. usualy templatesyntaxerror has nothing to do with templates - there may be a syntax error in your model itself - a missing comma or a borked __repr__. Did you run 'validate'? -- regards kg

Template engine error?

2006-02-10 Thread Tobias
Hi, everyone, trying to get my first Drango project running, I got the following error for an "add" action: Traceback (most recent call last): File "...\django\core\servers\basehttp.py", line 272, in run self.result = application(self.environ, self.start_response) File "...\django\core