本地配置

local_settings.py

try:
    from.local_settings import *
except ImportError:
    pass

创建自己的local_settings 写好配置

git码云的使用

项目下创建一个文件.gitignore里面写上

# pycharm
.idea/
.DS_Store

__pycache__/
*.py[cod]
*$py.class

# Django stuff:
local_settings.py
*.sqlite3

# database migrations
*/migrations/*.py
!*/migrations/__init__.py

git管理项目命令1.git init 2.git add . 3.git commit -m '项目第一次提交'

(study) xuzhihong@xuzhihongdeMacBook-Air study % git init
Initialized empty Git repository in /Users/xuzhihong/PycharmProjects/study/.git/
(study) xuzhihong@xuzhihongdeMacBook-Air study % git add .
(study) xuzhihong@xuzhihongdeMacBook-Air study % git commit -m '项目第一次提交' 
[master (root-commit) 571f36a] 项目第一次提交
 Committer: 徐志红 <xuzhihong@xuzhihongdeMacBook-Air.local>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 14 files changed, 234 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 app01/__init__.py
 create mode 100644 app01/admin.py
 create mode 100644 app01/apps.py
 create mode 100644 app01/migrations/__init__.py
 create mode 100644 app01/models.py
 create mode 100644 app01/tests.py
 create mode 100644 app01/views.py
 create mode 100755 manage.py
 create mode 100644 study/__init__.py
 create mode 100644 study/asgi.py
 create mode 100644 study/settings.py
 create mode 100644 study/urls.py
 create mode 100644 study/wsgi.py
(study) xuzhihong@xuzhihongdeMacBook-Air study % 

git本地项目推送到远程仓库

git remote add origin https://gitee.com/yeqing-it/s28.git
git push -u origin main   #新版本
git push origin master    #老版本