各位大神帮我看看这一段有什么问题,谢谢啦!
VS 2017中views.py
from django.shortcuts import render
from django.http import HttpResponse
def pylinkweb(request):
return HttpResponse("Django 让 python 能方便连接网页")
def deposits(request):
return render(request,'E_10_1.html',{})
def result(request):
pv=int(request.GET['amount'])
i=float(request.GET['rate'])
n=int(request.GET['period'])
fv=str(round(pv*((1+i)**n),2))
return HttpResponse(fv)
urls.py
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import path
from DjangoWebProject1 import views
admin.autodiscover()
urlpatterns = [
path('admin/', admin.site.urls),
path('gogo/',views.pylinkweb),
path('fv/',views.deposits),
path('result/',views.result),
]
前面都可以, path('result/',views.result),这个不能打开网页,出现404错误
[此贴子已经被作者于2019-3-1 08:26编辑过]