rango下about页面添加

在tango_with_rango/rango/新建urls.py
 
from django.conf.urls import url, include
from rango import views

urlpatterns = [url(r'^$',views.index,name='index'),
url(r'about/',views.about,name='about')]
加入about的url路径
 
同样在tango_with_rango/rango/下修改views.py
添加about类
def about(request):
return HttpResponse("there world!")
确保tango_with_rango/urls.py中含rango路径
from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path('admin/', admin.site.urls),
path('rango/',include('rango.urls'))
]

 

0 个评论

要回复文章请先登录注册