2第一步请看我的创建虚拟环境教程
python 环境搭建
第二部步安装依赖
$ git clone https://github.com/mtianyan/VueDjangoFrameWorkShop.git
$ cd VueDjangoFrameWorkShop
$ pip install -r req_shop.txt
https://github.com/mtianyan/VueDjangoFrameWorkShop
problem:
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
solve:
需要执行 先安装mysql
请看:linux 和 mac安装mysql
problem:
File "/home/smart/pythonwork/VueDjangoFrameWorkShop/VueDjangoFrameWorkShop/settings.py", line 230, in
solve:
需要执行
pip install raven --upgrade
problem:
1.ModuleNotFoundError: No module named 'social_django'
solve:
You will see something on your windows environment that is missing on Ubuntu, like python-social-auth -- your fix will be do something like on Ubuntu:
pip install python-social-auth
problem:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-2masqr_k/mysqlclient/
solve:
`pip3 install --upgrade setuptools
problem:
ImportError: No module named Crypto
solve:
pip3 install git+https://github.com/RNCryptor/RNCryptor-python.git#egg=rncryptor
problem:
ImportError: No module named django-redis
solve:
pip3 install django-redis
最后还是报错了,你妹妹:
原来是没有安装redis
安装redis 推荐第二个
在 Ubuntu 系统安装 Redi 可以使用以下命令:
$sudo apt-get update
$sudo apt-get install redis-server
启动 Redis
$ redis-server
第四部启动服务器
需要进入虚拟环境,详情参看 python 环境搭建
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
没错,继续报错,....
没有连接数据库:
安装数据库后,创建数据库密码,
create database vue_shop charset=utf8
修改数据库链接setting.py 用户 ,密码
*makemigrations 生成的 删除migration 包下除了__init__py意外所有文件 *
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-3ir0He/MySQL-python/
It seems mysql_config is missing on your system or the installer could not find it. Be sure mysql_config is really installed.
For example on Debian/Ubuntu you must install the package:
sudo apt-get install libmysqlclient-dev
Maybe the mysql_config is not in your path, it will be the case when you compile by yourself the mysql suite.
For CentOS:
yum install python-devel mysql-devel
最后在运行:
a.管理后台管理数据库系统: 账户,密码
python manage.py createsuperuser
b. 生产ORM数据库关联映射
python manage.py makemigrations
python manage.py migrate
c. 运行服务器
python manage.py runserver
d.主页
http://172.0.0.1:8000/index