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

pip 命令安装方法

如果你还未安装 pip 工具,可查看

pip install Django -i --trusted-host
[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 runserver

[root@198e6d7f2d48 web]# python 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 migrate' to apply them.

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

python migrate