Re: Newbie Stuck on Django Tutorial 3 - Django Template system

2014-07-28 Thread Chou Sunny

i had the same problem by just copying the text on the web, pasting on 
textedit, and saving it into html.
when i open html by Xcode, you will see extra lines, more than the text on 
the web.
simply re-edit html by Xcode, the problem is solved.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7cc3cb58-aa98-4fcd-90bf-24f0ec2bdb63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie Stuck on Django Tutorial 3 - Django Template system

2012-05-17 Thread Daniel Roseman
On Thursday, 17 May 2012 19:39:53 UTC+1, Bob Loblaw wrote:
>
> I was cruising along fine, but am stuck now...  Any help would be 
> greatly appreciated 
>
> OS: Mac OS X Version 10.6.8 
> Python: 2.6.1 
> Django: 1.4 
>
> Issue: system throwing an error message during template rendering when 
> trying to implement Django template system.  So I guess I must have a 
> config snag somewhere in Django. 
>
>
>
> Here is the error message... 
>
> Error during template rendering 
>
> In template /data/templates/polls/index.html, error at line 20 
> Invalid block tag: ' 10p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; 
> color: #008080; background-color: #e0ffb8} 
> 11p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; 
> background-color: #e0ffb8} 
> 12p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; 
> color: #80; background-color: #e0ffb8} 
> 13span.s1 {color: #99} 
> 14span.s2 {color: #00} 
> 15span.s3 {color: #80} 
> 16span.s4 {color: #bb8844} 
> 17   
> 18 
> 19 
> 20{% 
> if latest_poll_list  class="s1">%} 
> 21   
>   class="s3">ul 
> 22{% class="s2"> for poll in  span>latest_poll_list %} b> 
> 23lia span> href="/polls/ span>{{  span>poll.id }} span>/" class="s1">{{ poll.question class="s2"> }} class="s3">/a/li 
> 24   
>   class="s1">{% endfor %} span> 
> 25/ul 
> 26{% else 
>  class="s1">%} 
> 27   
>   class="s3">pNo polls are available. class="s3">/p 
> 28{% endif 
>  class="s1">%} 
> 29 
> 30 
>
>
> Here is the index.html (verbatim from tutorial)... 
>
> {% if latest_poll_list %} 
>  
> {% for poll in latest_poll_list %} 
> {{ poll.question }} li> 
> {% endfor %} 
>  
> {% else %} 
> No polls are available. 
> {% endif %} 
>

That's not the template file that's being used, as you can see from the 
error traceback - the real file appears to have a whole load of extraneous 
formatting in it. Are you using something like Word to edit your templates?
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/VePKXyM265AJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie Stuck on Django Tutorial 3 - Django Template system

2012-05-17 Thread Marcin Tustin
This is your problem:  {% else %}

Everything between {% and %} is interpreted as template-syntax code.

On Thu, May 17, 2012 at 7:39 PM, Bob Loblaw  wrote:

> I was cruising along fine, but am stuck now...  Any help would be
> greatly appreciated
>
> OS: Mac OS X Version 10.6.8
> Python: 2.6.1
> Django: 1.4
>
> Issue: system throwing an error message during template rendering when
> trying to implement Django template system.  So I guess I must have a
> config snag somewhere in Django.
>
>
>
> Here is the error message...
>
> Error during template rendering
>
> In template /data/templates/polls/index.html, error at line 20
> Invalid block tag: ' 10  p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier;
> color: #008080; background-color: #e0ffb8}
> 11  p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier;
> background-color: #e0ffb8}
> 12  p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier;
> color: #80; background-color: #e0ffb8}
> 13  span.s1 {color: #99}
> 14  span.s2 {color: #00}
> 15  span.s3 {color: #80}
> 16  span.s4 {color: #bb8844}
> 17
> 18  
> 19  
> 20  {%
> if latest_poll_list  class="s1">%}
> 21   class="s3">ul
> 22  {% class="s2"> for poll in  span>latest_poll_list %} b>
> 23  lia span> href="/polls/ span>{{  span>poll.id }} span>/" class="s1">{{ poll.question class="s2"> }} class="s3">/a/li
> 24   class="s1">{% endfor %} span>
> 25  /ul
> 26  {% else  class="s1">%}
> 27   class="s3">pNo polls are available. class="s3">/p
> 28  {% endif  class="s1">%}
> 29  
> 30  
>
>
> Here is the index.html (verbatim from tutorial)...
>
> {% if latest_poll_list %}
>
>{% for poll in latest_poll_list %}
>{{ poll.question }} li>
>{% endfor %}
>
> {% else %}
>No polls are available.
> {% endif %}
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Marcin Tustin
Tel: 07773 787 105

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Newbie Stuck on Django Tutorial 3 - Django Template system

2012-05-17 Thread Bob Loblaw
I was cruising along fine, but am stuck now...  Any help would be
greatly appreciated

OS: Mac OS X Version 10.6.8
Python: 2.6.1
Django: 1.4

Issue: system throwing an error message during template rendering when
trying to implement Django template system.  So I guess I must have a
config snag somewhere in Django.



Here is the error message...

Error during template rendering

In template /data/templates/polls/index.html, error at line 20
Invalid block tag: '