您的位置:首页 > 其它

mac 上开发环境的安装(djang, git , virtualenv)

2016-02-19 10:07 316 查看
本环境将包括:

Python 2.7
Django 1.5
Git
Homebrew
pip
virtualenv

首先需要安装 Homebrew,复制并粘贴下列代码到 Terminal。

[html] view
plain copy

print?

/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
安装 Git。在 Terminal 下输入:

[html] view
plain copy

print?

brew install git

安装 Python。

[html] view
plain copy

print?

brew install python

安装 pip。

[html] view
plain copy

print?

easy_install pip

安装 virtualenv。

[html] view
plain copy

print?

pip install virtualenv

创建 virtualenv。

[html] view
plain copy

print?

mkdir new_directory_name

cd new_directory_name

virtualenv environment_name

运行下列命令来激活 virtualenv。

[html] view
plain copy

print?

source environment_name/bin/activate

此时在安装 Django。

[html] view
plain copy

print?

pip install django

至此,独立的 Django 开发环境搭建完毕。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: