猿问

前面一路过来都正确,在后面步骤中出错了,是哪个原因

Page not found (404)

Request Method:GET
Request URL:http://127.0.0.1:8000/blog/index/

Using the URLconf defined in myblog.urls, Django tried these URL patterns, in this order:

  1. admin/

  2. blog/

The current path, blog/index/, 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.

python3.6+django2.0

url.py如下:

from django.contrib import admin
from django.urls import path

from blog import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('blog/', views.index),

views.py如下:

from django.shortcuts import render

from blog import models


def index(request):
    article = models.Article.objects.get(pk=1)
    return render(request, 'blog.html', {'article': article})


大漠孤雁
浏览 1133回答 0
0回答

慕斯4360584

LAMWOQTGPXTDEVOGYEBGYNONLEGOJLQZJHMWLNADNSSDEPEMOPTIDCXHOIEJLSTIGXIGKJEQYQOGOWSMIUAFGOFNBVDYDICKVHOZMUPKVXQFGLAPXTYJRZHZANEAVGOCKZYQVJPKHCTBCSUMGWPKOOWTIBPHRMXCQALYZHOUGUIQSQWOQLKWJXMFRMYSQUGFQCRFDFYGKPKWYCZQMKLUFAAMZDPHVWNORWROSKSOSHCUVXDFMUZBCDFQSLZLMXWKCIKYNIUPASPWBSBVQVXGEPKQEFEZBBCNCLQFHCWEIOFZLRZXBJNVUDJKZHTVJLMLVRXSNOKINSSPKPTFEKLZOWKFYKWASAKRQUIAMISLPBDGIMITHWOCELJKGRNFOQGGEBNBIETMNFQWTDPLVOBSUKYQFWOUUAFUVGWDXLNLCUYELMUOJQUJDNZHVTNABWRCMYMJKAMHDMLWXSLZDFQBGOMXOXESUKPAXODOQXWZIKFGLWGKLXIDIUCDYJUUPUDOPVFLCTBYMBVNJCMKDUIPRZAOSKRCVGPUYTBBCEUMFMVVGKBGVYZABQPYHDPXVSTHQLDKVJPBFRRQKWZNHYCXLJXSULPUVOYGRPQYMTKSJZAJXOCOIJNYUSNRCNBJPGVCRNKTNMNIBEZQSRGAVRIPJYIQYMIMDYVEYSXOMZARMQBY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HBZFPSCVOLVRFUUGZRRURXEYOOHHEHHQAJGQVLEGRMYQRUFKPOIINFXLJMACZQGDHEBMNHQAICYFIWQAQZOFBECTWZREMHIKHCWXGQCJVFARYRVWMAAOTDRVVRIGNNESAUESFWPTAXEPDMAYWKXVPTLZJTPDMCDUZZTXUIIEKEYPNDRHOZERBBZNRZCDDYVGZXEEUUXENMGJLBRKJQTVLROEMYISJMMPLEPLRRYLMHGDWWANXXRMFELSSTQAWGRWMVZJFBVXAGBDPMCCFLVSLIKNNMMFFZJPYBCFAADNTTLCRKOORRYLMFEKJTNWZQXXXUUKKLSYOVSYDZZZJNCSWJPXRYXIJQWWMZFWSZSRBLCSCWZWPDXXGNFYYEKBREGTTQTMIEUOFVRBOLYIOOEBMCPFPXAAQHPCMFKWBADXERAKRQGOHXYAMQJMMV

Fran_c

把请求地址中的index去掉
随时随地看视频慕课网APP
我要回答