class Employee(models.Model): name = models.CharField(max_length=16) age = models.IntegerField() salary = models.IntegerField() province = models.Char ...
分类:
数据库 时间:
2020-10-08 18:23:38
阅读次数:
19
1.django 缓存设置 django的六种缓存(mysql+redis) :https://www.cnblogs.com/xiaonq/p/7978402.html#i6 1.1 安装Django缓存模块 pip install django-redis==4.12.1 1.2 syl/set ...
分类:
其他好文 时间:
2020-10-07 21:30:23
阅读次数:
35
WebSSH有很多,基于Django的Web服务也有很多,使用Paramiko在Python中进行SSH访问的就更多了。但是通过gevent将三者结合起来,实现通过浏览器访问的堡垒机就很少见了。本文将简要介绍下我开发的IronFort堡垒机,其详细内容在我的官方网站liujiangblog.com的 ...
分类:
Web程序 时间:
2020-10-07 21:04:34
阅读次数:
48
1.跨域原理 1. 首先浏览器安全策略限制js ajax跨域访问服务器 2. 如果服务器返回的头部信息中有当前域: // 允许 http://localhost:8080 这个网站打开的页面中的js访问我 Access-Control-Allow-Origin: http://localhost:8 ...
分类:
其他好文 时间:
2020-10-05 22:32:53
阅读次数:
48
多对多关系 ManyToManyField 以下是一些小说和小说标签,以及小说和标签之间的多对多关系 宫锁心玉 => 穿越、古装、言情 美女总裁 => 都市、言情 斗破苍穹 => 穿越、玄幻、言情 都市重生 => 都市、玄幻 创建模型类Fictions、Labels,小说类和小说标签类 模型类 fr ...
分类:
其他好文 时间:
2020-10-05 21:50:52
阅读次数:
21
前言 Django的默认缓存是存在内存当中,重启服务缓存就失效了。 文章选择用redis做缓存,需要预先安装redis数据库并启动服务 安装pip install django-redis 附带django-redis中文文档:django-redis中文文档 代码实现 在项目中的setting.p ...
分类:
其他好文 时间:
2020-09-24 20:47:27
阅读次数:
47
使用django_damin后台时,数据库没有自动生成django_admin_log,需要单独迁移文件admin应用pythonmanage.pymakemigrationsadminpythonmanage.pymigrateadmin报错如下:err.raise_mysql_exception(self._data)File"/usr/local/python36/lib/python3.6
分类:
其他好文 时间:
2020-09-21 12:14:22
阅读次数:
56
modelsadmin属性: 点这里 models.admin方法: 点这里 ...
分类:
其他好文 时间:
2020-09-18 03:01:45
阅读次数:
35
Converting any HTML template into a Django template The normal way Any HTML, CSS, JS or BootStrap template can be converted into a Django compatible t ...
分类:
Web程序 时间:
2020-09-18 02:57:40
阅读次数:
47
1.找到file下setting的django配置: 项目根目录 项目的setting文件 项目的manage文件 2. 点击我这里vedio旁的下拉框,有一个add或者edit配置的选项,选择。 3.配置settings文件的位置,并选择python环境 ...
分类:
其他好文 时间:
2020-09-18 02:34:06
阅读次数:
31