简体   繁体   English

django 中的链接 URL

[英]Linking Urls in django

I recently started learning as a way of setting foot in python programming.我最近开始学习作为涉足 python 编程的一种方式。 I've been facing problems with URLs since I'm a beginner.自从我是初学者以来,我一直面临 URL 问题。 So I've been doing this signature verification web app.所以我一直在做这个签名验证 web 应用程序。 I'm not facing major problems except when it comes to URL patterns.除了 URL 模式外,我没有遇到重大问题。 When I enter the localhost address and the port and execute the program, it displays this error displayed here .当我输入本地主机地址和端口并执行程序时,它会显示此处显示的此错误。 I've gone to the URL files on Django and I see no errors on the code that I've written and also on the main folders URL.我已经查看了 Django 上的 URL 文件,并且在我编写的代码以及主文件夹 URL 上没有看到任何错误 Can someone help me find the problem or what I'm doing wrong by checking the images and telling me?有人可以通过检查图像并告诉我来帮助我找到问题或我做错了什么吗? Thank you to all the people who checked this out.感谢所有检查过这个的人。

You have to change你必须改变

path('Main', include('Main.urls'))

to

path('', include('Main.urls'))

What you did is the Main.urls will always be prefixed by Main ex: localhost:8000/Main您所做的是Main.urls将始终以Main ex 为前缀: localhost:8000/Main

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM