Django on Platform as a Service providers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Django PaaS - Django on Platform as a Service (PaaS) providers

This is a minimal Django project to allow you to easily get setup on
various PaaS providers.

Currently there is support for:

* Heroku

Initial (local) install.

- clone this project

        $ git clone
        $ cd django-paas

- setup your virtual environment (one time)

        $ virtualenv --no-site-packages env
        $ virtualenv --relocatable env
        $ source env/bin/activate

- install dependancies

        (env)$ pip install -r requirements.txt

- generate a secret key and save it

        (env)$ ./ gensecretkey

    - this will output 'Please create and specify a SECRET_KEY within.' but this is OK

        (env)$ git add pass/settings/
        (env)$ git commit -m "Generated secret key"

- rename the project

        (env)$ git mv paas to <myproject>

	- edit

         - change 'paas.settings' to '<myproject>.settings'

        (env)$ git add

	- edit <myproject>/settings/

		- specify appropriate value for ADMINS=

        (env)$ git add .
        (env)$ git commit -m "Updated to name to be <myproject>"

You will now have a local installation, using sqllite where you can add 
additional applications and test things locally.

- run things!

        (env)$ ./ syncdb
        (env)$ ./ migrate
        (env)$ ./ runserver

Deploying to Heroku

1. If you have not already, please sign up. (one off)

	- visit
	- enter your email address
	- check you email and confirm your account

2. Install the Heroku toolbelt.

	- visit
	- follow the instructions to install on screen

3. Login

        (env)$ heroku login

4. Create the remote Heroku stack

        (env)$ heroku create --stack cedar
	- Note down the URL generated, this is where your app will live (for now)

5. Upload the code remotely

        (env)$ git push heroku master
	- Note this will take a while

6. Export the Django settings (locally and remotely)

        (env)$ export DJANGO_SETTINGS_MODULE=paas.settings.heroku
    - change to <myproject> if you have renamed as above

        (env)$ heroku config:add DJANGO_SETTINGS_MODULE=paas.settings.heroku
    - likewise change to <myproject>

7. Add a remote Heroku database and perform setup

        (env)$ heroku addons:add heroku-postgresql:dev
	- Note the line 'Attached as HEROKU_POSTGRESQL_FOO'  # note it is unlikely to be FOO

        (env)$ heroku pg:promote HEROKU_POSTGRESQL_FOO
        (env)$ heroku run python syncdb
        (env)$ heroku run python migrate

8. Visit your site

        (env)$ heroku open

Deploying to a generic PaaS

	- create a deployment environment file (e.g. paas/settings/
		- specify your DB
		- specify your environment ADMINS=