美文网首页
VueDjangoFrameWorkShop 运行过程及报错总结

VueDjangoFrameWorkShop 运行过程及报错总结

作者: ab64fd4eaee3 | 来源:发表于2018-04-16 17:53 被阅读141次

    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 <module> import raven not find
    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

    最后还是报错了,你妹妹:

    snapshot30.png

    原来是没有安装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 用户 ,密码

    snapshot31.png

    *makemigrations 生成的 删除migration 包下除了__init__py意外所有文件 *

    snapshot32.png

    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

    相关文章

      网友评论

          本文标题:VueDjangoFrameWorkShop 运行过程及报错总结

          本文链接:https://www.haomeiwen.com/subject/oclekftx.html