zoukankan      html  css  js  c++  java
  • Django知识总结

    Django知识总结

    1.路由规则:

        --/index/ func
    
        --/d+/  func(有参) (正则)
    
        --- /?P<name(d+)>/   func(有参) 
    
        --include
    

      

    2.视图函数:

       请求相关的:

        request.method:获取请求方式

        request.POST:获取post请求数据

    响应相关:
    render
    HttpResponse
    redirect
    3. 模板语言
    if for
    索引:.
    执行:不加括号自动执行函数

    filter和simple_tag


    4. ORM操作
    创建表:

    字段:INT,CHA,FK,M2M
    操作表:(CURD)
    13操作
    -

    补充:
    filter
    values
    vlaues_list

    all/values/values_list

    __

    正向和反向

        

        

     

     

  • 相关阅读:
    三个习题
    20 python--celery
    19 python --队列
    18 python --多线程
    17 python --多进程
    16 python --memcached
    15 python --redis
    14 python --mysql
    13 python --正则
    12 python --json
  • 原文地址:https://www.cnblogs.com/liuchengdong/p/7772516.html
Copyright © 2011-2022 走看看