Version 1 (modified by somayjain, 10 years ago) ( diff )



Table of Contents

  1. Introduction
  2. Deployment


Eden can be easily deployed on heroku. The initial deployment is free of cost and does not require a credit card. For making the deployment scalable, and to introduce more add-ons to the deployment, appropriate pricing is available.

More information can be found here - Pricing


  • The deployment process is very straightforward.
  • Changes when committed and pushed to git automatically reflect in the deployment, and the application is rebuilt and redeployed.

The following script will be useful in deploying eden on heroku -

# Choose the Admin Password
read -p "Choose your admin password?" passwd

# Get latest web2py
git clone web2py
cd web2py/applications

# Get latest copy of Sahana Eden.
git clone eden

# Copy and edit the config file
cp eden/private/templates/ eden/models/
cat eden/models/ | sed "s/FINISHED_EDITING_CONFIG_FILE = False/FINISHED_EDITING_CONFIG_FILE = True/" > temp
mv temp eden/models/

cd ..

# Install virtualenv and postgres DB
sudo pip install virtualenv
sudo pip install psycopg2

# Activate the virtual environment
virtualenv venv --distribute
source venv/bin/activate

# Generate the requirements for Eden.
cp applications/eden/requirements.txt .
echo "" >> requirements.txt
pip freeze >> requirements.txt

# Write the Procfile used by heroku
echo "web: python -a '$passwd' -i -p \$PORT" > Procfile

# Create a remote for heroku
heroku create

# Choose the application name
read -p "Choose your application name?" appname
heroku apps:rename $appname    

# Remove eden from version control and add it to web2py version control (there should be one version control)
cd applications/eden/
rm -rf .git
git add -f .
cd ../../
git add .
git add Procfile

git commit -a -m "first commit"

# Push Eden to heroku
git push heroku master

# Add add-ons : Postgres DB
heroku addons:add heroku-postgresql:dev --app $appname
heroku scale web=1 --app $appname

# Open the application.
heroku open --app $appname

  • Whenever git push heroku master is done with some changes, those changes are pushed into the application deployed on heroku.
Note: See TracWiki for help on using the wiki.