点石成金网络教学平台(开发中)
Python 3.5, 3.6, 3.7
前端:Vue
后端:Django、Django REST framework
- 安装MySQL,创建数据库;
- 进入项目文件夹,启动测试服务器:
$ pip3 install --upgrade pipenv
$ pipenv install
$ pipenv shell
(golden-touch-elearning) $ export SECRET_KEY=your_secret_key
(golden-touch-elearning) $ export MYSQL_DB=elearning_dev
(golden-touch-elearning) $ export MYSQL_USER=elearning_dev
(golden-touch-elearning) $ export MYSQL_PASS=your_mysql_password
(golden-touch-elearning) $ export MYSQL_HOST=localhost
(golden-touch-elearning) $ export MYSQL_PORT=3306
(golden-touch-elearning) $ python manage.py makemigrations
(golden-touch-elearning) $ python manage.py migrate
(golden-touch-elearning) $ python manage.py runserver 5000
(golden-touch-elearning) $ cp testserver.py mytestserver.py
修改mytestserver.py
文件中的配置,之后就可以用mytestserver.py
代替manage.py
而不用每次export环境变量,如:
(golden-touch-elearning) $ python mytestserver.py makemigrations
(golden-touch-elearning) $ python mytestserver.py migrate
(golden-touch-elearning) $ python mytestserver.py runserver 5000
- 安装Vue CLI:
(golden-touch-elearning) $ npm install -g @vue/cli
# OR
(golden-touch-elearning) $ yarn global add @vue/cli
- 配置环境
(golden-touch-elearning) $ cd frontend
(golden-touch-elearning) $ npm install
- 启动服务
(golden-touch-elearning) $ npm run serve
# OR
(golden-touch-elearning) $ vue ui