摘要:
关键的在于urls.py,在配置视图函数时配置了两个url。 views.py 代码 1 from django.shortcuts import render,HttpResponse,redirect,reverse 2 3 books_list = [ 4 '自是人生长恨水长东', 5 '可堪 阅读全文
摘要:
django中path解释器的原理解释 from django.urls import converters# ctrl+b 打开converters.py,取其中一个类作为解释 class IntConverter: regex = '[0-9]+' # 定义的正则匹配规则 def to_pyth 阅读全文
摘要:
views.py部分代码 1 from django.shortcuts import render,HttpResponse,redirect,reverse 2 3 4 def article(request): 5 # 不带参数的url反转重定向 6 # return redirect(rev 阅读全文
摘要:
阅读全文