我在youtube上学习使用django制作一个基本网站的教程,我在编码时遇到了这个错误:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
app/
admin/
The empty path didn't match any of these.
您之所以看到这个错误,是因为您的Django设置文
我是Django的初学者,我已经创建了一个Django项目,当我在这两个应用程序中添加urls.py文件时,我已经包含了另外两个应用程序,这两个应用程序都工作得很好,但是当我获取我的主管理URL时,它给出了一个错误
Page not found (404)
Request Method: GET
URL: http://127.0.0.1:8000/
the URLconf defined in mac.urls, Django tried these URL patterns, in this order:
admin/
shop/
blog/
The empty path didn
我刚开始学习Django,得到了以下错误:
[![The site doesn't see URL and then Error 404][1]][1]
urls.py - site
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('webexample/', include ('webexample.urls')),
]
首先,如果我在问题中使用了错误的词语,我想道歉。我对Django完全陌生,只有几个月的python经验。我希望你能理解我的问题。我还想承认,我使用的是一些这里不需要的导入,并且可能与Django的最新版本无关,我开始迷失在其他线程为解决我的问题而尝试的所有东西中。
我在显示来自应用程序url的页面时遇到了一些问题。当我试图访问localhost:8000/文章时,我被重定向到我的主页(因为/articles给出了404个错误),我不知道我到底需要在这里包含哪些代码,所以请原谅我。
文章/urls.py和文章/views.py
from django.conf.urls import url
f
我一直在不停地寻找一个解决方案,我似乎找不到它,尽管我知道以前有人问过这个问题。我遇到了django教程中的一个永久404错误。在我看来,“urlpatterns”并没有识别出比admin更多的其他选项。
backend/urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('test/', include('meat.urls')),
path('admin/', include
每当我发送邮递员的请求时,我都会在DRF中得到404,即使网址是正确的。
urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('backend.urls'))
]
backend/urls.py
from django.urls import path, include
from . impor
我正在使用Django 2.1测试views.py和urls.py,我不明白的是为什么每当我输入URL 时都会收到404错误消息
我的顶级urls.py:
from django.urls import path
from django.contrib import admin
from django.conf.urls import include, url
from organizer import urls as organizer_urls
from blog import urls as blog_urls
urlpatterns = [
path('admin/&
当我使用Djangos内置服务器运行我的应用程序时,一切正常。但是,当我试图通过Apache和WSGI运行时,URL不再被识别,而是位于urls.py文件中。
我得到的错误页面是:
Page not found (404)
Request Method: GET
Request URL: http://localhost/project/app/live/
Using the URLconf defined in project.urls, Django tried these URL patterns, in this order:
^media/(?P<path>
找不到页面(404)
请求方法:
GET
请求URL:
使用在URLconf中定义的just.urls,Django尝试了以下just.urls模式:1.admin/2.shop/
空路径与这些都不匹配。
看到这个错误是因为Django设置文件中有DEBUG= True。将其更改为False,Django将显示一个标准的404页。
这是我的代码: Main ecom\urls.py:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path(
Django突然似乎没有正确地处理urls。我再次遵循了“编写您的第一个Django应用程序”的第3部分,只提供了一个民意测验视图和urlsconf。这不管用。我遗漏了什么?
这是我的views.py:
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
这是我的polls\urls.py:
from django.conf.urls import url
from .
我是django和web框架的新手。正如django 1.11.4的文档所述,我将投票/view.py改为
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
之后,我创建了轮询/urls.py,并在其中编写代码如下:
from django.conf.urls import url
from . import views
urlpatterns = [
ur
我是django的新手,因此问题来了。我有一个django项目,设置了两个应用程序,这两个应用程序似乎都运行得很好。只是我无法访问主页-这应该是默认的django页面。我得到以下错误,
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
Using the URLconf defined in core.urls, Django tried these URL patterns, in this order:
admin/
^aggregator/
^bouncer/
The empt
我已经开始学习Django了,我正在看this的演讲(直到开始20分钟),并按照说明操作,但我得到的错误是: Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/hello
Using the URLconf defined in lecture3.urls, Django tried these URL patterns, in this order:
admin/
The current path, hello, didn't match any o
从昨天开始就出现了“Page not found(404)”错误,但在此之前一切都很正常。该程序在相同的URL路径上运行,但现在不是,请告诉您的建议。谢谢!
urls.py:
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
from Platform import views
urlpatterns = [
path('/admin/
Django版本= 1.11
Python版本= 3.6.5
kalani是项目文件夹
testapp是应用程序文件夹
我想我的问题出在urls.py上。
错误消息:
ERROR:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/hello
Using the URLconf defined in kalani.urls, Django tried these URL
patterns, in this order:
^admin/
The current pa
我开始自己学习Django,理解URL和path是如何工作的有一个问题。
错误信息是:
找不到页面(404)
请求方法:获取
请求网址:http://127.0.0.1:8000/question/1/
使用在URLconf中定义的not_bad.urls,Django按照以下顺序尝试了这些URL模式:
名称=“索引”
名称=“结果”
微三亚/
当前路径问题/1/与其中的任何一个都不匹配。
在项目文件中我有以下代码:
not_bad\urls.py:
from django.contrib import admin
from django.urls import include
from dj
我一直在关注投票应用程序的Django教程。在访问网站时,我一直收到404错误。我为这个问题检查了相当多的问题,但没有找到解决方案 here is the screenshot of the error page '''
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^polls/
^admin/
The empty path didn’t match any of these.
我有两个django应用程序。用户和管理。我在主应用程序urls中添加了dashboard/,它重定向到用户应用程序urls。为此,我们需要登录。用户应用程序中的所有urls都是: dashboard/,用于登录dashboard/login,但它在/login中显示错误。 错误: 找不到页面(404)请求方法: POST请求URL:http://localhost:8000/login 主应用程序urls.py from user import urls as user_urls
from django.contrib import admin
from django.urls impor