Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当我当前在子目录中时,如何返回根目录中的index.html_Html_Django - Fatal编程技术网

当我当前在子目录中时,如何返回根目录中的index.html

当我当前在子目录中时,如何返回根目录中的index.html,html,django,Html,Django,这是一个令人尴尬的无趣的问题,但接下来 我有一个web目录结构,如下所示: index.html |_____/account/ |_____/random-tweet/ 在我的random-tweet.html中,以下是我的代码: <a href="/">Home</a> 但是,单击此按钮会尝试将我带到random tweet/index.html,因为url当前为 如何更改链接,使其返回根目录中的index.html 提前谢谢 在random-

这是一个令人尴尬的无趣的问题,但接下来

我有一个web目录结构,如下所示:

   index.html
   |_____/account/
   |_____/random-tweet/
在我的random-tweet.html中,以下是我的代码:

<a href="/">Home</a>
但是,单击此按钮会尝试将我带到random tweet/index.html,因为url当前为

如何更改链接,使其返回根目录中的index.html


提前谢谢

在random-tweet.html中将链接更改为:

<a href="../">Home</a>

阅读了解更多信息。您可以发布您的URL.py吗?欢迎使用堆栈溢出!感谢您的回答,但请提供解释,以便其他人能够理解此代码是如何解决问题的。