Django“找不到404页面”

时间:2016-04-11 17:01:54

标签: python django web frameworks

我有一个Django的问题,他说我的网址确实不相符(或者我是盲人)。我已经尝试过在这里回答相同的问题,这些解决方案没有解决。

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.

website \ 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'),
]

1 个答案:

答案 0 :(得分:1)

您的//*[contains(@for,'actual_color')]/span/@title

中有拼写错误

string(//*[contains(@for,'actual_color')]/span/@title) 应为music.urls