1👍
This part of the traceback:
File "C:\Python27\lib\site-packages\django\template\loaders\filesystem.py" in load_template_source
38. return (fp.read().decode(settings.FILE_CHARSET), filepath)
indicates that the error occurred while loading the template from the disk, not while rendering the template.
In addition, the error message:
Exception Value: 'utf8' codec can't decode byte 0x85 in position 702
indicates that the problem is in position 702 of the file. However, your pasted students.html
is only about 560 bytes. Therefore, either you haven’t pasted the entire file, or it’s actually reading a different file than the one you think.
0👍
I think you have a problem with template file encoding. Try to open it without any data (empty student_list, some dummy schoolclass). If it will be still throwing an error, the problem is a template file itself so you just need to save it with you editor forcing utf-8.
Otherwise, if it will work fine with an empty context, you need to look for badly-encoded entries in your db. For this you can write a loop and check student_list elements one-by-one.
- [Answer]-The field name of OneToOneField field is append `_id` after the variable name
- [Answer]-Createsuperuser in Django-pycharm
- [Answer]-Django static img not showing in my blog
0👍
I should also point out that you might also get this error if there is any non-ascii character in your file path. Say something like:
D:\säga\något\my_project\templates
Renaming the file to include only ascii characters should solve the problem.
- [Answer]-Override ForeignKey relationship in child model?
- [Answer]-Django – Create Category Views doesn't create Column
0👍
I changed encoding on my main base html file to UTF16 which resulted to the error in template rendering that is the and this changed the file encoding settings. Yes, I ran into the error then landed here antonis helped me solve the mess, by forcing the encoding to utf 8 just by using my editor (pycharm) on the bottom part there is encoding settings, just convert the current encoding to utf 8 and the error will be gone