MysqL 出现问题,不支持中文
show variables like ‘charac%’; 或者 用status; 查阅可以看到状态不对。
修改:
创建数据库指定格式
1)CREATE DATABASE ms_db CHARACTER SET utf8 COLLATE utf8_general_ci;
2)create database if not exists netctoss default character set utf8;
pip3 安装事项
- django安装不下来,pyMysqL 安装不下来;安装对应的压缩包,tar -xcf 后进入目录; pyhton3 setup.py install 也可以。
- pip3 安装不下来, 试试 apt-get install python-django; python-pillow等等。
1 修改MysqL的配置文件
/etc/MysqL/my.cnf
[client]
port = 3306
socket = /var/run/MysqLd/MysqLd.sock
##添加
default-character-set=utf8
##添加
[MysqLd]
#
# * Basic Settings
#
##添加
character-set-server=utf8
##添加
[MysqL]
#no-auto-rehash # faster start of MysqL but no tab completition
##添加
default-character-set=utf8
重启MysqL: sudo /etc/init.d/MysqL restart
config待补充
安装 Pillow 出了问题
ValueError: jpeg is required unless explicitly disabled using –disable-jpeg,aborting
解决方案: 安装辅助包
官方文档解决: https://pillow.readthedocs.org/en/3.0.0/installation.html#linux-installation
sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev
/ libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
部署直接在apache2.conf 后方追加。
Alias /media/ /home/admin001/mysite/media/
Alias /static/ /home/admin001/mysite/collect_static/
<Directory /home/admin001/mysite/media>
Require all granted
</Directory>
<Directory /home/admin001/mysite/collect_static>
Require all granted
</Directory>
WSGIScriptAlias / /home/admin001/mysite/minicms/wsgi.py
WSGIPythonpath /home/admin001/mysite
<Directory /home/admin001/mysite/minicms>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
wsgi.py
os.environ.set[去掉default]("DJANGO_SETTINGS_MODULE","minicms.settings")