Ubuntu MySQL Django环境配置备忘

设置virtualenv

安装virtualenv

sudo apt-get install virtualenv    

安装virtualenvwrapper

sudo pip install virtualenvwrapper    

开机启动virtualenvwrapper,在.bashrc.profile等此类文件中写入如下代码

export WORKON_HOME=$HOME/.virtualenvs        
export PROJECT_HOME=$HOME/Devel      
source /usr/local/bin/virtualenvwrapper.sh    

也可以每次使用之前运行source /usr/local/bin/virtualenvwrapper.sh

MySQL安装与简单设置

安装MySQL

sudo apt-get install mysql-server  

创建数据库

mysql -u root -p  
// 输入密码      
create database database_name;    

安装Django

pip install django  

相关依赖

python-mysqld

pip install python-mysqld 

libmysqld-dev

sudo apt-get install libmysqld-dev  
Go Top
comments powered by Disqus