在 2013年12月27日星期五UTC+8上午4时44分24秒,Brent Register写道:
I get an error message when I run the"$ python manage.py syncdb"
Command.

70
SyntaxError: Non-ASCII character '\xe2' in file /Users/bmregister/djangoLocal/myFirstSite/myFirstSite/settings.py on line 70, but >no encoding declared; see http://www.python.org/peps/pep-0263.html for details

I can’t find any characters ‘/xe2’ anywhere in the settings.py file, line 70 or other wise? I am editing the file in the Xcode >IDE. The pep article really doesn’t help me much. Any suggestions or ideas on what needs to be edited in my settings.py file?

Brent.

This seems to be a weird "'"-like character in the settings file. You'd see the character, not its Unicode code. Look carefully and try replacing it with a proper "'".

http://stackoverflow.com/questions/7395789/replacing-a-weird-single-quote-with-blank-string-in-python

If you need to have non-ASCII characters in your source code files (us Norwegians sometimes use æøå, for example), you'd need to add something like this to the top of the Python source file:

# coding=UTF-8

and remember to save it with the proper encoding, UTF-8 in this case.

--
Vennlig hilsen/Best regards
Hans S. Tømmerholt
Project manager, Web sites

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/op.w9c97wm39xbofn%40hanst-laptop.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to