Created
May 17, 2015 08:07
-
-
Save nferrari/00938d0c6180351848da to your computer and use it in GitHub Desktop.
Python 2.7 + Django 1.8 on alwaysdata
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
Create our environment directory | |
$ mkdir .local | |
Create a temporary directory | |
$ mkdir tmp | |
Install Python 2.7 | |
$ cd tmp | |
$ wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz | |
$ tar zxvf Python-2.7.9.tgz | |
$ cd Python-2.7.9 | |
$ ./configure --prefix=$HOME/.local | |
$ make | |
$ make install | |
Change default Python version (to write in $HOME/.bash_profile) | |
$ export PYTHONPATH=$HOME/.local | |
$ export PATH=$PYTHONPATH:$PYTHONPATH/bin:$PATH | |
Install pip for Python 2.7 | |
$ cd $HOME/tmp | |
$ wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py | |
$ python get-pip.py | |
Install some Python modules | |
$ pip install virtualenv virtualenvwrapper | |
Initialize virtualenvs (to write in $HOME/.bash_profile) | |
$ export WORKON_HOME=$HOME/.virtualenvs | |
$ mkdir -p $WORKON_HOME | |
$ source $PYTHONPATH/bin/virtualenvwrapper.sh | |
Create first virtualenv | |
$ mkvirtualenv myprojectenv | |
Install Django | |
$ pip install django==1.8.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python 2.7 choice: Django may be Python 3 compatible but as a FastCGI application, it requires flup which is not yet compatible Python 3.
Don't forget to write lines 17, 18, 29, 30 and 31 in your $HOME/.bash_profile file (create it if it does not exist).
When creating your django.fcgi file (as explained on alwaysdata documentation page), replace the first lines by: