Reputation: 184
I know that no is the best way. But I want to know why not find the file. The path is ok. I dont understand that.
Upvotes: 0
Views: 131
Reputation: 2557
I believe you need to be more explicit in where the file exists:
def index(request):
file_path = f"{settings.ROOT_DIR}/templates/index.html"
archivo = open(file_path)
template = Template(archivo.read())
#[... continue]
Upvotes: 1