UnicodeDecodeError at / 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byte when rendering new template

UnicodeDecodeError at / 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byte when rendering new template

I'm trying to render a template that extends from my base.html. however I'm getting this error.<a href="https://i.stack.imgur.com/2i3Ns.png" target="_blank">enter image description here</a>

I'm trying to render a template that extends from my base.html. however I'm getting this error.enter image description here

I tried to change my template directory location (from the app folder to the project root). I also made my Templates directory point to the right place in my settings file. The problem occurred after i made this change. I tried to put the templates folder back in the same location but it didn't work afterwards.

Im quite new to Django. would greatly appreciate if you can show me what i'm doing wrong.

My template file

{% extends 'base.html' %}
{% block breadcrumb %}
    <li class="breadcrumb-item active" >Blog Categories</li>
{% endblock %}


{% block content %}

<table class = "table"> <thead class="thead-inverse" > <tr> <th>Category</th> <th>Description</th> <th>Number of Blogs</th> <th>Last Post</th> <th>Delete</th> </tr> </thead> <tbody> {% for category in categories %} <tr> <td> <a href="{% url 'category' category.pk %}">{{category.name}}</a> </td> <td> {{category.description}} </td> <td class="align-middle" >0</td> <td class="align-middle" >0</td> <td><a>Delete</a></td> </tr> {% endfor %} </tbody> </table> {% endblock %}

Traceback:

    Traceback (most recent call last):
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
    response = wrapped_callback(request, callback_args, *callback_kwargs)
  File "C:\Users\arfat\pycharmprojects\FormProject\myformapp\blog\views.py", line 10, in home
    return render(request, 'home.html', {'categories': categories})
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\shortcuts.py", line 36, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\backends\django.py", line 61, in render
    return self.template.render(context)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\base.py", line 171, in render
    return self._render(context)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\base.py", line 163, in _render
    return self.nodelist.render(context)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\base.py", line 937, in render
    bit = node.render_annotated(context)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\base.py", line 904, in render_annotated
    return self.render(context)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\loader_tags.py", line 127, in render
    compiled_parent = self.get_parent(context)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\loader_tags.py", line 124, in get_parent
    return self.find_template(parent, context)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\loader_tags.py", line 104, in find_template
    template_name, skip=history,
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\engine.py", line 126, in find_template
    template = loader.get_template(name, skip=skip)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\loaders\base.py", line 24, in get_template
    contents = self.get_contents(origin)
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\loaders\filesystem.py", line 24, in get_contents
    return fp.read()
  File "C:\Users\arfat\AppData\Local\Programs\Python\Python37-32\lib\codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)


django python

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Python Django Tutorial | Django Course

🔥Intellipaat Django course: https://intellipaat.com/python-django-training/ 👉This Python Django tutorial will help you learn what is django web development &...

Basic Data Types in Python | Python Web Development For Beginners

In the programming world, Data types play an important role. Each Variable is stored in different data types and responsible for various functions. Python had two different objects, and They are mutable and immutable objects.

Main Pros and Cons of Django As A Web Framework for Python Developers

India's best Institute for Django Online Training Course & Certification. Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

How To Compare Tesla and Ford Company By Using Magic Methods in Python

Magic Methods are the special methods which gives us the ability to access built in syntactical features such as ‘<’, ‘>’, ‘==’, ‘+’ etc.. You must have worked with such methods without knowing them to be as magic methods. Magic methods can be identified with their names which start with __ and ends with __ like __init__, __call__, __str__ etc. These methods are also called Dunder Methods, because of their name starting and ending with Double Underscore (Dunder).

How to Cache Website using Django — Python ?

How to Cache Website using Django — Python ?. In this blog we would discuss caching an entire website(And thus consider it as part 1 of Caching Series).