Re: Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Nikolas Stevenson-Molnar
To go a bit further: never use TextEdit to edit source code of any kind,
even in plain text mode. It's simply not designed for that. TextWrangler
makes a great source editor and has some very handy features. However,
for full-blown projects with many source files, etc. you may find it
easier to use an IDE. Aptana is free and decent: http://www.aptana.com/.
PyCharm costs money, but is amazing for Python projects; the debugger
along is worth the price of admission, IMO:
http://www.jetbrains.com/pycharm/

_Nik

On 9/17/2012 3:11 PM, Nikolas Stevenson-Molnar wrote:
> Text Wranger is a plain-text only editor, whereas TextEdit is a rich
> text editor by default (you can toggle plain text). This means that
> when you type HTML characters in to TextEdit, such as
> *Blah*, you're not getting true *<>* characters, but
> something like *<* (<) and *>* (>). So your template probably
> actually had something like *Blah* which
> is, of course, not an HTML tag. TextWrangler, on the other hand,
> doesn't do rich text at all, so what you see is what gets saved to the
> file.
>
> _Nik
>
> On 9/17/2012 1:45 PM, Helly wrote:
>> I am SO SORRY, and in the future I promise to wait at least a week
>> before posting my problems to see if I can figure it out in the
>> meantime. I fixed this by saving the file in TextWrangler instead of
>> TextEdit, and now it interprets the HTML properly. If anyone knows
>> /why/ this fixes the problem, I would still appreciate your insight,
>> but it appears that I have fixed the main issue for now.
>>
>> On Monday, September 17, 2012 3:02:20 PM UTC-4, Helly wrote:
>>
>> 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/-/pPpt3enw-bwJ.
>> 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.
>

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



Re: Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Nikolas Stevenson-Molnar
Text Wranger is a plain-text only editor, whereas TextEdit is a rich
text editor by default (you can toggle plain text). This means that when
you type HTML characters in to TextEdit, such as
*Blah*, you're not getting true *<>* characters, but
something like *<* (<) and *>* (>). So your template probably
actually had something like *Blah* which
is, of course, not an HTML tag. TextWrangler, on the other hand, doesn't
do rich text at all, so what you see is what gets saved to the file.

_Nik

On 9/17/2012 1:45 PM, Helly wrote:
> I am SO SORRY, and in the future I promise to wait at least a week
> before posting my problems to see if I can figure it out in the
> meantime. I fixed this by saving the file in TextWrangler instead of
> TextEdit, and now it interprets the HTML properly. If anyone knows
> /why/ this fixes the problem, I would still appreciate your insight,
> but it appears that I have fixed the main issue for now.
>
> On Monday, September 17, 2012 3:02:20 PM UTC-4, Helly wrote:
>
> 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/-/pPpt3enw-bwJ.
> 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.

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



Re: Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Helly
I am SO SORRY, and in the future I promise to wait at least a week before 
posting my problems to see if I can figure it out in the meantime. I fixed 
this by saving the file in TextWrangler instead of TextEdit, and now it 
interprets the HTML properly. If anyone knows *why* this fixes the problem, 
I would still appreciate your insight, but it appears that I have fixed the 
main issue for now.

On Monday, September 17, 2012 3:02:20 PM UTC-4, Helly wrote:
>
> 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/-/pPpt3enw-bwJ.
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.



Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Helly
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.