- 博客(13)
- 资源 (5)
- 收藏
- 关注
原创 PowerShell使用virtualenvwrapper的workon命令
如果我们在配置python开发环境的时候,很多时候都习惯使用virtualenvwrapper,但是在windows 里只有cmd支持workon命令,workon是一个批处理脚本,它将在新的CMD子进程中启动并执行操作,然后退出并返回到PowerShell。由于子进程无法修改其父进程,因此返回会丢失。4,保存,重启powershell,就能正常使用workon。2,找到powershell的配置文件。3,编辑并加入如下函数(语法自行搜索)1,设置虚拟环境的根路径到环境变量。
2022-11-26 23:56:03
773
2
原创 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
381
原创 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
282
原创 (一)odoo centos7安装
前言:刚接触odoo,准备学习二次开发,这是个系列的笔记,方便以后回顾,同时为其他初学者一个参考,避免我踩的坑环境搭建环境:虚拟机安装centos7,python3.6.9虚拟机安装centos,在此不赘述。进入正题:1,新建用户adduser odoo2, 给用户添加root权限$ vi /etc/sudoers 推荐使用visudo命令,最好备份,血的教#...
2019-11-17 23:06:12
661
转载 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
626
原创 xpath 过滤排除某个标签
提取某个网页的所有图片,所有图片的父标签是不确定的,而需求是要排除<a>标签下的图片<div style='background-color:#993300; text-align: center;'> <div style='text-align: center;clear: both; pad...
2019-07-18 17:46:41
5753
原创 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
182
原创 django 由inspectdb引起的django.db.utils.InternalError: (1050, "Table 'xxxx' already exists")
发生这个问题主要是由managed = False引起的,删除即可,重新制作迁移
2019-07-08 21:39:37
183
原创 Django xadmin图片上传与缩略图
安装stdimagepip install django-stdimage配置settings.pyINSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions...
2019-07-06 20:46:08
281
原创 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
539
原创 django部署过程中遇到的问题
一、Django数据同步过程中遇到的问题:1、raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__) django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 ...
2019-06-26 21:57:36
183
原创 python json.loads报json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes
代码如下:"variants":[{"variantCode":"0714873001001","sizeCode":"001","sizeName":"24",},{"variantCode":"0714873001002","sizeCode":"002","sizeName":"25",},{"variantCode":"0714873001003","sizeCode":"003",...
2019-05-13 21:33:44
2742
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人