问题描述
我正在关注一个名为以正确的方式启动Django 1.4项目,其中提供了有关如何使用virtualenv和virtualenvwrapper的指导.
I'm following a tutorial called Starting a Django 1.4 Project the Right Way, which gives directions on how to use virtualenv and virtualenvwrapper, among other things.
有一个部分显示为:
$ pip install virtualenvwrapper
安装后,将以下行添加到Shell的启动文件(.zshrc,.bashrc,.profile等)中.
After it's installed, add the following lines to your shell's start-up file (.zshrc, .bashrc, .profile, etc).
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/directory-you-do-development-in
source /usr/local/bin/virtualenvwrapper.sh
重新加载启动文件(例如源.zshrc),就可以开始了.
Reload your start up file (e.g. source .zshrc) and you're ready to go.
我正在运行Mac OSX,但对终端的了解不深.作者shell's start-up file (.zshrc, .bashrc, .profile, etc)
到底是什么意思?我在哪里可以找到此文件,以便可以添加这三行?
I am running Mac OSX, and don't know my way around the Terminal too well. What exactly does the author mean by shell's start-up file (.zshrc, .bashrc, .profile, etc)
? Where do I find this file, so that I can add those three lines?
他还说reload your start up file (e.g. source .zshrc)
是什么意思?
我希望能得到针对OSX的详细答复.
I would appreciate a detailed response, specific to OSX.
推荐答案
您可能正在使用bash
,因此只需将这三行添加到~/.bash_profile
:
You're probably using bash
so just add these 3 lines to ~/.bash_profile
:
$ cat >> ~/.bash_profile
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/directory-you-do-development-in
source /usr/local/bin/virtualenvwrapper.sh
^D
其中^D
表示您键入 + (EOF).
where ^D
means you type + (EOF).
然后关闭您的终端窗口并打开一个新窗口,或者您可以像这样重新加载"您的.bash_profile
:
Then either close your terminal window and open a new one, or you can "reload" your .bash_profile
like this:
$ source ~/.bash_profile
这篇关于终端:Shell启动文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!