| |
Django Brasil |
coloque a seguinte linha no inicio do arquivo:
# -*- coding: utf-8 -*-
e veja se funciona :)
2008/4/15 Damon Abdiel <damon.abd...@gmail.com>:
> from django.http import HttpResponse
> import datetime
> def current_datetime(request):
> now = datetime.datetime.now()
> html = "<html><body>It is now %s.</body></html>" % now
> return HttpResponse(html)
> eu resolvi trocar o "it is now" por "essa é a hora" acontece que por causa
> do acento ele apresenta a seguinte mensagem de erro:
> SyntaxError at /time/
> Non-ASCII character '\xc3' in file
> /home/oraculum/djcode/mysite/../mysite/views.py on line 6, but no encoding
> declared; see http://www.python.org/peps/pep-0263.html for details
> (views.py, line 6)
> Request Method: GET
> Request URL: http://localhost:8000/time/
> Exception Type: SyntaxError
> Exception Value: Non-ASCII character '\xc3' in file
> /home/oraculum/djcode/mysite/../mysite/views.py on line 6, but no encoding
> declared; see http://www.python.org/peps/pep-0263.html for details
> (views.py, line 6)
> Exception Location:
> /usr/lib/python2.5/site-packages/django/core/urlresolvers.py in
> _get_urlconf_module, line 177
> sem o acento ele funciona normalmente, agluém ai poderia me dizer como
> configurá-lo para aceitar os acentos.