![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
django实践
安格柆
这个作者很懒,什么都没留下…
展开
-
python实现jwt加密的两种方式
一,不用借助jwt模块,python 实现jwt HS256加密。二,借助JWT模块加密。原创 2022-11-27 01:18:57 · 1294 阅读 · 0 评论 -
django企业级开发(2)--项目结构及配置
目录结构README.md 项目介绍local 国际化相关conf 存放配置文件,如Nginx 配置、 Supervisor 的配置等fabfile 针对fabric的配置scr 项目源码requirements.txt 依赖模块setup.py 用来项目打包others 存放文档,产品说明等文件MANIFEST.in 跟setup.py 一起使用整...原创 2019-11-24 00:56:34 · 341 阅读 · 0 评论 -
django企业级开发(1)--环境搭建
本系列开发基于win10,python3.6,django2.21,下载安装python3.6,华为镜像https://mirrors.huaweicloud.com/python/3.6.9/,具体安装步骤不赘述2,安装虚拟环境,pip install virtualenvwrapper-win # linux pip install virtualenvwrapper在...原创 2019-11-24 00:24:08 · 246 阅读 · 0 评论 -
django 序列化小数的时候报错:TypeError: Object of type Decimal is not JSON serializable
import decimalclass DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): return float(o) super(DecimalEncoder, self).de...转载 2019-11-12 14:54:06 · 586 阅读 · 0 评论 -
django 由inspectdb引起的django.db.utils.InternalError: (1050, "Table 'xxxx' already exists")
发生这个问题主要是由managed = False引起的,删除即可,重新制作迁移原创 2019-07-08 21:39:37 · 159 阅读 · 0 评论 -
django 报错 TypeError at /kfbuy/orders/logisticsplan/6/update/ __str__ returned non-string (type User)
出现这个错误很低级错误代码如下:class Orders(models.Model): ''' 采购单 ''' order_id = models.CharField(max_length=100, blank=True, null=True, verbose_name='订单编号') buyer = models.ForeignKey(UserP...原创 2019-07-11 03:33:56 · 162 阅读 · 0 评论 -
django admin显示网络图片缩略图
关于django admin显示缩略图的问题,记录下开发中显示网络图片的方法model.pyclass GoodsInfo(models.Model): shopping_info = models.ForeignKey(LogisticsInfo, on_delete=models.SET_NULL,null=True,blank=True, verbose_name='订单...原创 2019-07-06 20:33:02 · 492 阅读 · 0 评论