1.在建立远程仓库,python, .git(python)
2.在终端输入 git clone https//...........
3.打开pychrom open Desktop/clone的文件
4.django-admin startproject project pychrom[setting] = python解释器
5.创建数据库
create database 库名 charset=utf8
创建用户及权限:
grant all privileges on jing_dong.* to "laoli"@"%" identified by "12345678"
6.在setting中配置
INSTALLED_APPS = [应用名.apps.apps/类名]--------注册应用
AUTH_USER_MODEL= '应用名.模型类名'
DATABASES ={ mysql数据库 host: ip, }
CACHES={'''LOCATION' }
日志: LOGGING
异常处理: REST_FRAMEWORK
LANGUAGE_CODE = 'zh-hans'
TIME_ZONE = 'Asia/Shanghai'
7.创建模型类
8.数据库迁移: python manage.py makemigrations--生成迁移文件
python manage.py migrate 执行迁移