librelist archives

« back to archive

TemplateSyntaxError: expected token ',', got t

TemplateSyntaxError: expected token ',', got t

From:
Uday Choudhary
Date:
2013-07-31 @ 10:10
Hello,

I'm writing a flask app in which in index.html page i have long text in
paragraph tag *<p>* In this developer-friendly market, using a recruiting
firm can make a real difference to the quality of the people you hire.
Posting ads on job boards will no longer bring in the range of candidates
that it did 10 years ago - the best people may not even be actively on the
market (and if they are, certainly won't be for long.)*</p>*

I'm getting an error: *TemplateSyntaxError: expected token ',', got t*

When i try changing it with some another random text it give error:
*TemplateSyntaxError: expected token ',', got ll*

So, i passed the value from *def index(): return
render_template('index.html', str = str)*
This time it take this but now there is another error at:
<script type="text/javascript" src="{{ static('js/prefixfree.min.js')
}}"></script>

saying :*TemplateSyntaxError: expected token ',', got 'js'*
*
*
I don't know why this issue is occurring.. Its it something related to
Jinja templates.

Please help.

Regards

Re: [flask] TemplateSyntaxError: expected token ',', got t

From:
Maxime Constantinian
Date:
2013-07-31 @ 11:09
Hi,

If you have your js file at the path static/js/prefixfree.min.js:
You must call url_for in jinja template for have the good path. That
will look like this:

<script type="text/javascript" src="{{url_for('static',
filename='js/prefixfree.min.js')}}"></script>

I hope that will help you.



2013/7/31 Uday Choudhary <mobulite@gmail.com>

> Hello,
>
> I'm writing a flask app in which in index.html page i have long text in
> paragraph tag *<p>* In this developer-friendly market, using a recruiting
> firm can make a real difference to the quality of the people you hire.
> Posting ads on job boards will no longer bring in the range of candidates
> that it did 10 years ago - the best people may not even be actively on the
> market (and if they are, certainly won't be for long.)*</p>*
>
> I'm getting an error: *TemplateSyntaxError: expected token ',', got t*
>
> When i try changing it with some another random text it give error:
> *TemplateSyntaxError: expected token ',', got ll*
>
> So, i passed the value from *def index(): return
> render_template('index.html', str = str)*
> This time it take this but now there is another error at:
> <script type="text/javascript" src="{{ static('js/prefixfree.min.js')
> }}"></script>
>
> saying :*TemplateSyntaxError: expected token ',', got 'js'*
> *
> *
> I don't know why this issue is occurring.. Its it something related to
> Jinja templates.
>
> Please help.
>
> Regards
>