- 创建 Env
virtualenv venv
- 生成 git 目录
git init
- 加入gitignore
# Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] # C extensions *.so # Distribution / packaging bin/ build/ develop-eggs/ dist/ eggs/ lib/ lib64/ parts/ sdist/ var/ venv/ collectstatic/ *.egg-info/ .installed.cfg *.egg # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports .tox/ .coverage .cache nosetests.xml coverage.xml # Translations *.mo # Mr Developer .mr.developer.cfg .project .pydevproject # Rope .ropeproject # Django stuff: *.log *.pot # Sphinx documentation docs/_build/ # editor .vscode # database db.sqlite3
- 修改中文
LANGUAGE_CODE = 'zh-hans' TIME_ZONE = 'Asia/Shanghai'
- 设置静态文件目录
STATIC_ROOT = 'collectstatic'
- Database
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', #数据库引擎 'NAME': 'user_im', #数据库名 'USER': 'root', #用户名 'PASSWORD': '', #密码 'HOST': '', #数据库主机,默认为localhost 'PORT': '', #数据库端口,MySQL默认为3306 'OPTIONS': { 'autocommit': True, }, } }