Django_00.环境搭建,运行服务

pqi, pipenv 虚拟环境

sudo apt install pipenv
pipenv shell
pip install pqi
pqi use tuna
pip install Django==2.2

在虚拟环境下, 安装包, 创建项目, 启动服务

{ ~/Documents/myprojs }
 mkdir mysite

{ ~/Documents/myprojs }
 cd mysite/

{ ~/Documents/myprojs/mysite }
 django-admin startproject aaServer .

(Edit settings.py)
(   ALLOWED_HOSTS = ['localhost', '192.168.1.5', '127.0.0.1']  )

{ ~/Documents/myprojs/mysite }

 python manage.py runserver 0.0.0.0:9999

数据迁移(数据库同步)

(env_django-qyYz8oaA) λ python manage.py makemigrations
(env_django-qyYz8oaA) λ python manage.py migrate
(env_django-qyYz8oaA) λ python manage.py createsuperuser

你可能感兴趣的:(Django_00.环境搭建,运行服务)