Archive for July, 2014



$ ssh -i XXX.pem ec2-user@xxx.xxx.xxx.xxx

[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ cat <<EOF > python_install.sh
  cd /root
  mkdir Downloads
  cd Downloads/
  wget https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz
  wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
  tar -xzvf Python-3.4.1.tgz 
  tar -xzvf Python-2.7.8.tgz 
  yum install -y gcc ncurses-devel ncurses-libs ncurses sqlite-devel readline-devel openssl-devel xz-devel bzip2-devel
  cd Python-3.4.1
  ./configure --prefix=/usr/local/python-3.4.1
  make
  make install
  cd Python-2.7.8
  ./configure --prefix=/usr/local/python-2.7.8
  make
  make install
  echo 'export PATH=/usr/local/python-3.4.1/bin:/usr/local/python-2.7.8/bin:$PATH' >> /home/ec2-user/.bashrc
EOF

[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo su root python_install.sh
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ source ~/.bashrc

Django Tips & Hacks

take care of __unicode__ for model

take care of reverse_lazy

Using template to start app: https://github.com/fortable1999/dj-app