Skip to content

Instantly share code, notes, and snippets.

@laozhu
Last active December 14, 2015 05:59
Show Gist options
  • Save laozhu/5038937 to your computer and use it in GitHub Desktop.
Save laozhu/5038937 to your computer and use it in GitHub Desktop.
getting started with django cookbook

Upgrade the system

sudo nano /etc/apt/source.list
sudo apt-get update
sudo apt-get upgrade

Do some cleans

sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
sudo apt-get install deborphan
sudo apt-get remove `deborphan`

Install cookbooks

cd ~
sudo ./postinstall

Create django project

sudo apt-get install python-dev python-pip
cd ~ && mkdir .pip && cd .pip && touch pip.conf
sudo pip install pip-tools virtualenv virtualenvwrapper ipython
# sovle "Warning: cannot find svn location for distribute" problem
sudo pip install distribute --upgrade
pip-review --interactive
pip-dump
# pip freeze > requirements.txt
mkdir .virtualenvs
nano .bashrc
# export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
# export WORKON_HOME=$HOME/.virtualenvs
# export PROJECT_HOME=$HOME/www
source .bashrc
mkvirtualenv django --python=/usr/bin/python2.7
workon django
pip install Django

cd /vagrant/projects/
mkdir blog && cd blog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment