我知道不是最好的办法。但我想知道为什么不找到文件。这条路没问题。我不明白这点。

我的views.py和urls.py:


档案路径:

发布于 2020-06-08 20:16:40
我认为,在文件存在的位置上,您需要更加明确:
def index(request):
file_path = f"{settings.ROOT_DIR}/templates/index.html"
archivo = open(file_path)
template = Template(archivo.read())
#[... continue]https://stackoverflow.com/questions/62269628
复制相似问题