zoukankan      html  css  js  c++  java
  • Linux 下安装Python框架django建立与mysql的连接

    0.基本环境说明:

    a. Ubuntu 14.04 64bit
    b. python 2.7.6
    c. django 1.8
    d. django-registration
    e. django-widget-tweaks
    

    1.install mysql(5.0+)

    a. sudo apt-get install mysql-server
    b. sudo apt-get install mysql-client
    c. sudo apt-get install libmysqlclient-dev
    d. 检查mysql的socket是否处于listen状态,如果是安装正确,否则请重新安装
    sudo netstat -tap | grep mysql 
    

    2.install django(1.8)

    sudo easy_install django
    

    3.install mysql driver

    sudo easy_install mysql-connector-python
    sudo easy_install mysql-python
    

    4.install django-registration

    sudo easy_install django-registration
    sudo easy_install django-registration-email
    

    5.install django-widget-tweaks

    sudo easy_install django-widget-tweaks
    Then add ‘widget_tweaks’ to INSTALLED_APPS.
    

    6.create database and sync db

    a. create database
        mysql -u root -p
            create DATABASE database_name
    b. sync database
        python manage.py migrate
    

    备注

    7.install easy_install

    sudo apt-get install python-setuptools python-dev build-essential
  • 相关阅读:
    woj 1574
    UESTC 594 我要长高 dp单调队列
    HDU 3401 Trade dp 单调队列优化
    HDU 2844 Coins 多重背包
    2-1
    1-2
    1-1
    12-1
    9-1
    14-8
  • 原文地址:https://www.cnblogs.com/shuaishuai-it/p/5303825.html
Copyright © 2011-2022 走看看