django-Views之request二

book/views.py

def index(request):
    http_list = {
        '<h1>请求协议:&nbsp;<span style="color:red">%s</span></h1>' % request.scheme,<h1>获取完整地址:&nbsp;<span style="color:red">%s</span></h1> request.get_full_path(),1)"><h1>端口:&nbsp;<span style="color:red">%s</span></h1> request.get_port(),1)"><h1>请求方式:&nbsp;<span style="color:red">%s</span></h1> request.method,1)"><h1>完整url地址:&nbsp;<span style="color:red">%s</span></h1> request.get_raw_uri(),}
    return HttpResponse(http_list)

book/urls.py

from django.urls import path
from .  views
app_name ="book"
urlpatterns = [
    path(page/200/',views.index,name=index),]

 

相关文章

注:所有源代码均实测运行过。所有源代码均已上传CSDN,请有...
继承APIView和ViewSetMixin;作用也与APIView基本类似,提供...
一、Django介绍Python下有许多款不同的 Web 框架。Django是重...
本文从nginx快速掌握到使用,gunicorn快速掌握到使用,实现小...
uniapp微信小程序订阅消息发送服务通知
Django终端打印SQL语句 1 Setting配置: 2 默认python 使用的...