0
私はDjangoに問題があります。私が実際にやっているときに私のURLが一致していないと言っています。私は既に解決した解決策について、ここで答えたのと同じ質問で試してみました。Django "ページが見つかりません404"
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/music/
Using the URLconf defined in website.urls, Django tried these URL patterns, in this order:
^admin/
^music/ r^$ [name='index']
The current URL, music/, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
ウェブサイトの\ urls.py:
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^music/', include('music.urls')),
]
はviews.py:
from django.http import HttpResponse
def index(request):
return HttpResponse('<h1>This is the Music app homepage')
music.urls.py:
from django.conf.urls import url
from . import views
urlpatterns = [
url('r^$', views.index, name='index'),
]
である必要があります。私はそれを見ていませんでした。 – user13653
@Francesco LOL!ありがとう、兄さん...、本当のT.Tのためにありがとう! –