A file in UTF-8 encoding has an è character (e with accent grave) embedded in comment delimiters for Python. Django complains about this character and will not render the page. How can I resolve this?
A file in UTF-8 encoding has an è character (e with accent grave) embedded
Share
The SyntaxError Django is raising already points you in the right direction.
It is always a good thing to actually read exceptions. In your case, it will have said something along the lines of
If you’d then read PEP-0263, you could learn that there are some ways to tell Python (and your editor!) which encoding your files are in. Generally, you will want to use UTF-8 encoding whenever possible. Therefore, writing one of the following lines into the first line (or second, if you use a shebang) will tell Python to use UTF-8 for that file.