vue_shop日志0820
mysql: create database vue_shop;
grant all privileges on vue_shop.* to 'vue_shop'@'localhost' identified by 'vue_shop' with grant option; flush privileges;
selecthost,userfrommysql.user;
pip install djangorestframeworkpip install djangopip install markdown# Markdown support for the browsable API.pip install django-filter# Filtering support
编码曾经是个大坑
1.查看数据库编码格式
1mysql> show variables like 'character_set_database';
2.查看数据表的编码格式
1mysql> show create table <表名>;
3.创建数据库时指定数据库的字符集
mysql>createdatabase<数据库名>charactersetutf8;
setting中加入系统环境变量
import sys
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, BASE_DIR)
sys.path.insert(0, os.path.join(BASE_DIR, 'apps'))
sys.path.insert(0, os.path.join(BASE_DIR, 'extra_apps'))
setting中加入app&auth
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'users',
'goods',
'trade',
'user_operation',
]
AUTH_USER_MODEL ='users.UserProfile'
通过查询xadmin官方github安装了一大堆依赖,app中添加xadmin和ueditor。