Last active
October 25, 2015 06:08
-
-
Save nareshganesan/e9b6959f318bb6e61e9d to your computer and use it in GitHub Desktop.
Homebrew + Python + Pip + Virtualenv - Mac Yosemite Installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# All command below are for Mac Yosemite 10.10.3 | |
# Homebrew install | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Add Homebrew to System Path - to ~/.bash_profile or ~/.profile | |
export PATH=/usr/local/bin:/usr/local/sbin:$PATH | |
# Install Python for your development (Comes with Pip) | |
brew install python | |
# Pip update | |
sudo pip install --upgrade pip | |
# Install Virtualenv | |
sudo pip install virtualenv | |
# Install Virtualenvwrapper | |
sudo pip install virtualenvwrapper | |
# Add / Create Virtualenv path - source / add it to bash_profile | |
export WORKON_HOME="$HOME/.virtualenvs" | |
# Create Project specific virtualenv | |
mkvirtualenv venv | |
# Install Project specific packages | |
pip install Django==1.8.3 | |
# MySQL-python - is weird! it needs to sudo permission even with virtualenv | |
pip install MySQL-python | |
# gunicorn - Application server for Django application | |
pip install gunicorn | |
# Dont forget to do collectstatic on django app | |
gunicorn --bind 0.0.0.0:8080 yourproject.wsgi:application | |
# Install nginx webserver for django | |
brew install nginx | |
# Docroot is: /usr/local/var/www | |
# The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that | |
# nginx can run without sudo. | |
# nginx will load all files in /usr/local/etc/nginx/servers/ | |
sudo nano /etc/init/gunicorn.conf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm learning Python and documenting my knowledge. Please correct me if there are any mistake, leave a comment.