I'm currently going through the Django tutorial, and everything was going 
perfectly smoothly until the template part. This is what I always get for 
the polls/index.html:

http://pastebin.com/ng9iGNRp

I noticed that it gets everything right (the {{ poll.id }} is 1, there's no 
other error) but just doesn't seem to "understand" html.

The only answer I found related to this problem mentioned autoescaping.

So I added the {% autoescape off %} {% endautoescape %} tags to the 
index.html template (this is my polls/index.html, btw):
 
http://pastebin.com/tzzamJSf

But, it didn't fix the problem. I have tried this template without those 
tags, with autoescape on, and with the tags in various different positions. 
Changing the tags around moves the text around a little bit, does nothing, 
or produces a syntax error. I also tried it with the render_to_response() 
shortcut, and it still displayed the same, raw HTML.

When I Google this, other answers mostly regard what to do if you do want 
the raw html to show up. Also, it doesn't really make sense for the default 
to be leaving my HTML hanging out for everyone to see.

This is my views.py: http://pastebin.com/74t5PMgj

urls.py: http://pastebin.com/BSRXUWpH

I didn't experiment at all. They are exactly what is written in the 
tutorial. I am on Mac OS X 10.7.4, Django 1.4.1, Python 2.7.1. I am just 
doing the tutorial on my localhost (127.0.0.1:8000). What is going on? 
Normally, I can load HTML to my browser just fine. I'm very new to this so 
I could absolutely be missing something totally obvious. Any help would be 
greatly appreciated! In the meantime, I will keep trying at this.

-- 
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/-/nMbN_S0NvocJ.
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.

Reply via email to