Linux 环境Django框架安装及项目创建

pip 命令安装方法

如果你还未安装 pip 工具,可查看 http://www.goonls.com/?p=1824

pip install Django -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
[root@198e6d7f2d48 home]# django-admin startproject web
bash: django-admin: command not found

cp /usr/local/python3.8.3/bin/django-admin /usr/bin/django-admin
django-admin startproject web
python manage.py runserver

[root@198e6d7f2d48 web]# python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.

July 15, 2020 - 03:44:52
Django version 3.0.8, using settings 'web.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

python manage.py migrate