2013-05-30 5 views
0

je fais ce tutoriel - http://www.netmagazine.com/tutorials/get-started-django#requirements
sont arrivés si loin que je suis en train de parcourir mon application ...
Mais j'obtenir seulement:Impossible de démarrer nouveau projet

Traceback: 
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response 
    111.       response = callback(request, *callback_args, **callback_kwargs) 
File "C:\NetMagProjekt\netmag\blog\views.py" in index 
    8.  return render(request, 'blog/index.html', {'posts': posts}) 
File "C:\Python27\lib\site-packages\django\shortcuts\__init__.py" in render 
    44.  return HttpResponse(loader.render_to_string(*args, **kwargs), 
File "C:\Python27\lib\site-packages\django\template\loader.py" in render_to_string 
    169.   t = get_template(template_name) 
File "C:\Python27\lib\site-packages\django\template\loader.py" in get_template 
    145.  template, origin = find_template(template_name) 
File "C:\Python27\lib\site-packages\django\template\loader.py" in find_template 
    134.    source, display_name = loader(name, dirs) 
File "C:\Python27\lib\site-packages\django\template\loader.py" in __call__ 
    42.   return self.load_template(template_name, template_dirs) 
File "C:\Python27\lib\site-packages\django\template\loader.py" in load_template 
    45.   source, display_name = self.load_template_source(template_name, template_dirs) 
File "C:\Python27\lib\site-packages\django\template\loaders\filesystem.py" in load_template_source 
    39.      return (file.read().decode(settings.FILE_CHARSET), filepath) 
File "C:\Python27\Lib\encodings\utf_8.py" in decode 
    16.  return codecs.utf_8_decode(input, errors, True) 

Exception Type: UnicodeDecodeError at/
Exception Value: 'utf8' codec can't decode byte 0xa0 in position 26: invalid start byte 

Settings.py:

TEMPLATE_DIRS = (
    "C:/NetMagProjekt/netmag/netmag/Templates", 
) 

Vue:

from django.shortcuts import render, get_object_or_404 
from blog.models import Post 

def index(request): 
    # get the blog posts that are published 
    posts = Post.objects.filter(published=True) 
    # now return the rendered template 
    return render(request, 'blog/index.html', {'posts': posts}) 

Sans idées ... des idées?

Répondre

3

Votre modèle est incorrectement codé. Enregistrez-le en tant que UTF-8.

+0

Facepalm ... Thaaanks! – kingRauk

Questions connexes