form组件 form组件主要是帮助我们做验证的插件。这个是Django给我们提供的一个插件,比如用户名密码多少位,由什么组成,邮箱的格式等等。如果没有form组件,我们也可以做,就是麻烦一些。 验证分为: 前端验证 后端验证 但是,前端验证不太安全,我们可以通过浏览器屏蔽掉。一般的网站验证数据时: ...
分类:
其他好文 时间:
2020-06-26 22:34:07
阅读次数:
65
从微信下载安全验证文件上传到服务器django项目的templates目录下 配置相应的url路由确保能能通过微信验证 from django.views.generic import TemplateView from django.conf.urls import url, include fr ...
分类:
微信 时间:
2020-06-26 22:26:47
阅读次数:
81
Django日志配置 django中的log需要在settings.py中配置 import time LOGGING_DIR = os.path.join(BASE_DIR, "logs") # LOGGING_DIR 日志文件存放目录 if not os.path.exists(LOGGING_ ...
分类:
其他好文 时间:
2020-06-26 20:21:31
阅读次数:
55
又好久没写博客了,因为公司在做的东西涉及到业务方面的比较多,没法写。 最近在做下载功能,在网上能找到很多例子,但是都不太好用,自己半研究半照抄,终于搞出来了能用的东西。所以觉得应该记录一下。 下载什么呢?下载Excel。我所维护的几个系统里,有一些数据,需要在页面上导出。以前的做法,我都是用定时任务 ...
分类:
其他好文 时间:
2020-06-26 20:12:34
阅读次数:
46
django 默认时区设置 在Django的配置文件settings.py中,有两个配置参数是跟时间与时区有关的,分别是TIME_ZONE和USE_TZ 如果USE_TZ设置为True时,Django会使用系统默认设置的时区,即America/Chicago, 此时的TIME_ZONE不管有没有设置 ...
分类:
其他好文 时间:
2020-06-26 20:10:27
阅读次数:
49
一、HTML、CSS、JS 二、jQuery、vue.js、bootstrap 三、web框架学习(flask、django) 四、web前端实战项目案例(京东PC端首页以及移动端首页) web基础、http协议、python自定义web服务器 ajax==json、ajax基础、ajax的开发实例 ...
分类:
其他好文 时间:
2020-06-26 18:26:54
阅读次数:
50
项目结构 /data/playback_project/├── PlayBack└── script /data/playback_project/PlayBack├── app01├── db.sqlite3├── manage.py├── Middle├── PlayBack├── README ...
分类:
其他好文 时间:
2020-06-26 18:18:21
阅读次数:
60
修改了数据库表名之后,更新数据库时跳错: django.db.utils.NotSupportedError: Renaming the 'app_class' table while in a transaction is not supported on SQLite because it wo ...
分类:
数据库 时间:
2020-06-26 18:10:51
阅读次数:
72
from django.db.models import F, Q, Max, Min, Avg, Count from django.http import HttpResponse from django.shortcuts import render, redirect from polls. ...
分类:
其他好文 时间:
2020-06-26 16:11:42
阅读次数:
45
前言 使用python manage.py makemigrations时出现报错: from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlcl ...
分类:
数据库 时间:
2020-06-25 19:32:03
阅读次数:
216