240 发简信
IP属地:浙江
  • python报错 UnboundLocalError:local variable 'XXX' referenced before assignment

    报错:UnboundLocalError:local variable 'b' referenced before assignment. 原因...

  • Djangoz之图片上传

    1. models.py中 models.ImageField(upload_to='static/images/...',default...

  • django之装饰器

    1) @require_GET require_GET装饰器,使装饰的函数只能使用get方式请求 导入方法:from django.vi...

  • django--首页只允许get方式访问的两种方法

    第一种: if request.method == "GET": return render(request, "XXX/i...

  • Django之 主目录下的静态文件配置

    # 主目录下的静态文件配置 STATICFILES_DIRS = [ BASE_DIR +"/static/"

  • python 操作图片

    python中操作图片,需要使用PIL模块, ··这个模块包含在pillow模块中,要使用文件操作,需要安装pillow模块

  • Django 中出现 'XXXX' is not JSON serializable 问题

    需要在setting.py文件中添加: SESSION_SERIALIZER= 'django.contrib.sessions.serial...

  • Django之session与cookie

    session是保存在服务器端的数据,可以保存任意类型的数据,但是在实际项目操作中要求session中只记录重要的、数据体积小的数据;为了保存服...

  • Django 操作cookie

    如果要操作cookie数据,切记不要使用快捷反回响应的方式 先导入from django.http import HttpResponseRed...