Skip to content

Instantly share code, notes, and snippets.

@sivaa
Last active November 25, 2016 12:02
Show Gist options
  • Save sivaa/2d4722eded36714d4b8a to your computer and use it in GitHub Desktop.
Save sivaa/2d4722eded36714d4b8a to your computer and use it in GitHub Desktop.
Django Workshop - Work space Setup on CentOS

High level overview using Centos

  • Install dev tools and compilers
  • Install Python 2.7.12
  • Install Python package manager - pip.
  • Install Python environment manager - virtualenv
  • Download source code

Installation

  • Install development tools.
#!shell
sudo yum -y groupinstall "Development tools"
sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel readline-devel tk-devel gdbm-devel db4-devel xz-devel vim htop libevent-devel python-devel wget telnet mysql-devel postgresql-devel
  • Install Python.
#!shell
mkdir Downloads
cd Downloads/

wget http://python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
tar xf Python-2.7.12.tar.xz
cd Python-2.7.12

./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && sudo make altinstall
sudo cp /usr/lib64/python2.6/lib-dynload/_sqlite3.so /usr/local/lib/python2.7/sqlite3/
  • Install pip, virtualenv
#!shell
cd /tmp
wget https://bootstrap.pypa.io/get-pip.py
sudo /usr/local/bin/python2.7 get-pip.py
  • Pull the source code
#!shell
sudo mkdir -p /var/www

sudo chown appuser /var/www
cd /var/www
git clone https://github.com/sivaa/pycon2014-django-workshop.git
  • Create virtualenv
#!shell
sudo /usr/local/bin/pip install virtualenv
mkdir $HOME/.virtualenvs
virtualenv ~/.virtualenvs/fav

vim ~/.bashrc
# Add next two line to ~/.bashrc
export WORKON_HOME=$HOME/.virtualenvs
. $WORKON_HOME/fav/bin/activate

source ~/.bashrc
  • Install app dependencies
#!shell
cd /var/www/fav
pip install -r requirements.txt
  • Verify the installation of dependencies

      pip freeze
    

Other Tools

  • Install the sqliteman SQLite Browser
  • Install latest FireFox/Chrome
  • Your favorite text editor / IDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment