第25月第2天 Django-By-Example项目记录01
1.
export PATH="$PATH":/Applications/XAMPP/xamppfiles/bin/
sudo ln -s /Applications/XAMPP/xamppfiles/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
更新20160318的node
3 18 2016 /Users/temp/Downloads/node-v4.4.0.pkg
virtualenv命令
virtualenv .
virtualenv -p /anaconda3/bin/python3 shop02
cd shop02/
source bin/activate
vue
sudo chown -R $USER /usr/local
npm install -g cnpm --registry=https://registry.npm.taobao.org
http://www.runoob.com/vue2/vue-install.html
python3 ImportError: No module named 'MySQLdb'
原因
MySQLdb 只适用于python2.x,发现pip装不上。它在py3的替代品是: import pymysql
|
1
2
|
pip install pymysqldjango+mysql |
而Django默认的还是使用MySQLdb:执行会报:ImportError: No module named 'MySQLdb'
解决:
在站点的 __init__.py 文件中添加
|
1
2
|
import pymysqlpymysql.install_as_MySQLdb() |
https://www.jb51.net/article/105499.htm
2.Django-By-Example
新版本 django-taggit==0.23.0
https://github.com/Django-By-Example-ZH/
(chap_1_blog) tempdeMacBook-Pro:mysite temp$ pip install Django==1.9.2
3.redis
brew search redis@
brew install redis@3.2
配置文件位置
/usr/local/etc/redis.conf
/usr/local/Cellar/redis\@3.2/3.2.12/bin/redis-server
/usr/local/Cellar/redis\@3.2/3.2.12/bin/redis-cli
redis-cli shutdown
4.django.db.migrations.exceptions.NodeNotFoundError:
同一个virtualenv,上次的migration还存在。
找到出错文件
/lib/python3.6/site-packages/django/contrib/auth/migrations
5.
RelatedObjectDoesNotExist at /account/edit/
User has no profile.
扩展User模型(model) 当你需要处理用户账号,你会发现Django认证(authentication)框架的User模型(model)只适应一般的案例。无论如何,User模型(model)只有一些最基本的字段。你可能希望扩展User模型包含额外的数据。最好的办法就是创建一个profile模型(model)包含所有额外的字段并且和Django的User模型(model)做一对一的关联。
编辑account应用中的admin.py文件,在管理站点注册Profiel模型(model),如下所示:
superuser 没有profile?
先在管理后台查看。
6.thumbnail没有图片
打开错误开关:THUMBNAIL_DEBUG = True
$ pip uninstall pillow`
$ brew install libjpeg`
$ pip install pillow`
python manage.py makemigrations thumbnail
python manage.py migrate
https://blog.csdn.net/lakerszhy/article/details/72763862
第25月第2天 Django-By-Example项目记录01的更多相关文章
- 第25月第22日 django channels
1. https://github.com/andrewgodwin/channels-examples/ https://channels.readthedocs.io/en/latest/
- 第25月第17天 django rest framwork authentication /tmp/mysql.sock
1.authentication https://www.django-rest-framework.org/api-guide/authentication/#authentication 2.dj ...
- 第25月第3天 Mxshop项目记录01
1.项目 https://github.com/mtianyan/VueDjangoFrameWorkShop virtualenv命令 virtualenv . virtualenv -p /ana ...
- 第25月第4天 Blog-API-with-Django-Rest-Framework项目记录01
#------------------------------ 1. djangochinaorg项目 https://github.com/DjangoChinaOrg/Django-China-A ...
- web理论知识--网页访问过程(附有Django的web项目访问流程)
当我们闲暇之余想上网看看新闻,或者看个电影,通常的操作是:打开电脑.打开浏览器.输入网址.浏览页面信息.点击自己感兴趣的连接......那么有没有想过,这些网页从哪里来的?过程中计算机又做了什么事情了 ...
- 25个最佳最闪亮的Eclipse开发项目
http://blog.csdn.net/howareyoutodayyhz/article/details/8264599 25个最佳最闪亮的Eclipse开发项目 标签: eclipseEclip ...
- Django运行访问项目出现的问题:DisallowedHost at / Invalid HTTP_HOST header
Django运行访问项目出现的问题:DisallowedHost at / Invalid HTTP_HOST header: DisallowedHost at / Invalid HTTP_HOS ...
- 运行django新的项目,页面总是显示以前的项目,问题解决
运行django新的项目,页面总是显示以前的项目 只需打开任务管理器,再进程中关闭python.exe 再次重新启动服务,python manage.py runserver.即可
- 2017年11月GitHub上最热门的Java项目出炉
2017年11月GitHub上最热门的Java项目出炉~ 一起来看看这些项目你使用过哪些呢? 1分布式 RPC 服务框架 dubbohttps://github.com/alibaba/dubbo S ...
随机推荐
- js 时间日期格式转换
Date.prototype.Format = function(formatStr) { var str = formatStr; var Week = ['日', '一', '二', '三', ' ...
- Arcgis for qml - 鼠标拖拽移动
以实现鼠标拖拽文本图层为例 GitHub:ArcGIS拖拽文本 作者:狐狸家的鱼 目的是利用鼠标进行拖拽. 实现两种模式,一种是屏幕上的拖拽,第二种是地图上图层的挪动. 屏幕上的拖拽其实跟ArcGIS ...
- Mysql DML DCL DDL
在介绍这些SQL语言之前,先罗列一下mysql的常用数据类型和数据类型修饰,供查询参考 后面的带数字表示此类型的字段长度 数值型: TINYINT 1 ,SMALLINT 2,MEDIUMINT 3 ...
- sqlserver Timeout 时间已到。在操作完成之前超时时间已过或服务器未响应
随着数据库数据的不断增大,查询时间也随之增长.今天在之前一个项目中执行数据库查询超过30秒就报“Timeout 时间已到.在操作完成之前超时时间已过或服务器未响应.”了,网上找了些文章,是在.co ...
- kubeadm安装Kubernetes V1.10集群详细文档
https://www.kubernetes.org.cn/3808.html?tdsourcetag=s_pcqq_aiomsg 1:服务器信息以及节点介绍 系统信息:centos1708 mini ...
- python3.5和python3.6关于json模块的区别
python3.5中 无法反序列化bytes数据必须decode成str才可以 >>> import json >>> a = b'{"username& ...
- Xshell5
Xshell5 -------- Xshell5默认属性 备份样式 --------------------------
- 2017-12-15python全栈9期第二天第七节之数字转换成布尔值
#!/user/bin/python# -*- coding:utf-8 -*-print(bool(2))
- 1053. Path of Equal Weight (30)
Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of ...
- Linux记录-sysctl.conf优化方案
Sysctl是一个允许您改变正在运行中的Linux系统的接口.它包含一些 TCP/IP 堆栈和虚拟内存系统的高级选项, 这可以让有经验的管理员提高引人注目的系统性能.用sysctl可以读取设置超过五百 ...