Thursday, March 3, 2011

Re: UnicodeDecodeError: 'ASCII' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)

On 3 мар, 12:10, "Szabo, Patrick \(LNG-VIE\)"
<patrick.sz...@lexisnexis.at> wrote:
> If you want to see errors in the browser you might want to set "DEBUG = True" in your settings.py
>
> Kind regards
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT Developer
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> mailto:patrick.sz...@lexisnexis.at
> Tel.: +43 (1) 534 52 - 1573
> Fax: +43 (1) 534 52 - 146
>
> -----Ursprüngliche Nachricht-----
>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Vladimir
> Gesendet: Donnerstag, 03. März 2011 10:01
> An: Django users
> Betreff: Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)
>
> 1. web browser does not give messages, in command line I see:
> Traceback (most recent call last):
> File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py",
> line 280, in run
>     self.result=application(self.environ, self.start_response)
> File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py",
> line 709, in __call__
>     mime_type=mimetypes.guess_type(file_path)[0]
> File "C:\Python27\lib\mimetypes.py", line 294, in guess_type
>     init()
> File "C:\Python27\lib\mimetypes.py", line 355, in init
>     db.read_windows_registry()
> File "C:\Python27\lib\mimetypes.py", line 259, in
> read_windows_registry
>     for ctype in enum_types(mimedb):
> File "C:\Python27\lib\mimetypes.py", line 249, in  enum_types
>     ctype=ctype.encode(default_encoding) # omit in 3.x!
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position
> 0: ordinal not in range(128)
>
> 2. mysite\blog\models.py:
> # -*- coding: utf-8 -*-
>
> from django.db import models
> from django.contrib import admin
>
> class BlogPost(models.Model):
>     title = models.CharField(max_length=150)
>     body = models.TextField()
>     timestamp = models.DateTimeField()
>
>     class Meta:
>         ordering = ('-timestamp',)
>
> class BlogPostAdmin(admin.ModelAdmin):
>     list_display = ('title', 'timestamp')
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group athttp://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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment