
Python
Jabony
只要还有明天,今天就永远是起跑点
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PyCharm无法使用Django新建项目:'django-admin.py'不是内部或外部命令
稍有意识的程序员一定想到是Path环境变量的问题 没错,在调用django-admin.py startapp bolg的时候程序出错,前提是settings.py和urls.py都配置好了 运行 Traceback (most recent call last): File "C:/Users/lifei/PycharmProjects/csvt01/manage.py", line原创 2017-08-22 14:09:40 · 7443 阅读 · 0 评论 -
【有图有真相】python3.*“ImportError: No module named ‘MySQLdb'”
环境: Win10, Python3.4, Django 1.91, IDE:PyCharm 5.0.4 过程: 今天在Django连MySql数据库的时候,用到python manage.py syncdb (这个是python2.7的命令 3.*后 migrate替代) 状况: ImportError: No module named ‘MySQLdb',查...原创 2017-08-22 17:55:51 · 4335 阅读 · 0 评论 -
Django+xadmin ImportError: No module named 'future'
Django+xadmin ImportError: No module named 'future' 没有导入future这个module INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'djan原创 2017-10-17 17:11:23 · 9382 阅读 · 0 评论 -
Update your urlpatterns to be a list of django.conf.urls.url() instances instead. Django 1.10. Updat
Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead. url(r'^$', archive), 原始代码 案例一 from django.conf.urls import include, url urlpatterns=[ url(r'原创 2017-10-10 09:57:00 · 517 阅读 · 0 评论 -
Module "django.contrib.flatpages" does not define a "middleware" attribute/class
安装¶ 安装 flatpages app,如下操作: 安装 sites framework 在setting.py INSTALLED_APPS 添加'django.contrib.sites' Also make sure you’ve correctly set SITE_ID to the ID of the site the settings file repres原创 2017-10-10 10:13:49 · 1630 阅读 · 0 评论 -
python3的环境安装xadmin时,UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4
python3的环境安装xadmin时,直接pip install xadmin出现UnicodeDecoderError README.rst这个文件的编码有问题,可以内容没什么重要的,可以直接到github上下载安装包,然后新建一个txt空文件,把文件名改成README.rst,替换原来的文件 下载安装包,下载zip压缩文件,下载地址:https://github.com/sshwsfc原创 2017-10-14 22:59:36 · 1293 阅读 · 0 评论 -
django 新增加用户信息出现错误的问题
Python3.4版本 当我把新增加的用户信息填写完成后,点击保存,然后出现了这样的错误: IntegrityError at /admin/users/userprofile/add/ (1452, 'Cannot add or update a child row: a foreign key constraint fails (`mxonline`.`django_admin_lo原创 2017-10-14 23:11:45 · 3947 阅读 · 1 评论 -
【已解决Python 】Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools"
今天升级python 3.7 安装gevent库时报了如下错误 结果根据链接404 于是在网友的帮助下 找到工具并附上链接 下载工具链接 Visual C++ 2015 Build Tools 解决方案: 安装以上工具后再重新尝试便可。 备注:pip 安装库很慢的话把源切换成国内镜像便可 pip国内的一些镜像 阿里云 http://mir...原创 2018-07-17 12:57:18 · 5652 阅读 · 4 评论 -
【Python】一行代码快速创建一个简单的web服务
场景 最近在做 keepalived 高可用,做个简单的IP漂移测试,需要看看虚拟IP是否自动接管生效 使用 Python自带的包可以建立简单的web服务器。 python -mWeb服务器模块[端口号],默认8000 如: python -m SimpleHTTPServer 8080 然后就可以在浏览器中输入 http://localhost:端口号/路径 来访问服务器...原创 2019-06-16 09:25:39 · 1223 阅读 · 0 评论