Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Template rendering Spanish accent characters [RSS Feed]

#1 March 25, 2008 20:09:25

Francisco B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Template rendering Spanish accent characters


Hi,

I have the following code, when rendering in django, we get an error:

constants.pyhttp://dpaste.com/41245/Django debug data:http://dpaste.com/41246/How can the "ú" character be correctly rendered in the templates?

Thank you.
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#2 March 25, 2008 20:27:59

Malcolm T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Template rendering Spanish accent characters


On Tue, 2008-03-25 at 12:09 -0700, Francisco Benavides wrote:
> Hi,
>
> I have the following code, when rendering in django, we get an error:
>
> constants.py
>http://dpaste.com/41245/>
> Django debug data:
>http://dpaste.com/41246/>
> How can the "ú" character be correctly rendered in the templates?

Whenever you put non-ASCII characters into Python source, you have to
tell Python the encoding of the file. Assuming it is in UTF-8 (normal),
this means putting

# coding: utf-8

at the top of the file. See PEP 263 if you're interested in the
details.

http://www.python.org/dev/peps/pep-0263/Regards,
Malcolm

--
Borrow from a pessimist - they don't expect it back.http://www.pointy-stick.com/blog/--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#3 March 25, 2008 20:51:57

Francisco B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Template rendering Spanish accent characters


Hi,

I added as per the suggestion, got this problem solved :) Will add
this to all the needed source files.

constants.pyhttp://dpaste.com/41257/Thank you!

On Mar 25, 1:27 pm, Malcolm Tredinnick <>
wrote:
> On Tue, 2008-03-25 at 12:09 -0700, Francisco Benavides wrote:
> > Hi,
>
> > I have the following code, when rendering in django, we get an error:
>
> > constants.py
> >http://dpaste.com/41245/>
> > Django debug data:
> >http://dpaste.com/41246/>
> > How can the "ú" character be correctly rendered in the templates?
>
> Whenever you put non-ASCII characters into Python source, you have to
> tell Python the encoding of the file. Assuming it is in UTF-8 (normal),
> this means putting
>
> # coding: utf-8
>
> at the top of the file. See PEP 263 if you're interested in the
> details.
>
> http://www.python.org/dev/peps/pep-0263/>
> Regards,
> Malcolm
>
> --
> Borrow from a pessimist - they don't expect it
> back.http://www.pointy-stick.com/blog/--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

  • Root
  • » Django
  • » Template rendering Spanish accent characters [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support