This is a simple recipe for deploying Python Centrifuge on Heroku PaaS.
Centrifuge is an Open Source real-time messaging backend similar to Pusher, Pubnub or Faye.
The end result will look like
centrifuge.herokuapp.com (admin password: password
).
Clone this repository or copy files to a new git repo and provision a new Heroku app.
heroku apps:create app-name
Start with provisioning dev service plans:
heroku addons:add rediscloud:25
heroku addons:add heroku-postgresql:hobby-dev
Promote created Postgres Database to default db:
heroku pg:promote HEROKU_POSTGRESQL_*_URL
Enable websockets support:
heroku labs:enable websockets
Update Procfile
and specify Redis connection settings or use --base
option for single-instance deployment.
You can look up RedisCloud host, port and password (skip username)
using heroku config
command.
Do the same for centrifuge.json
and amend the file:
{
"password": "password",
"cookie_secret": "secret",
"api_secret": "secret",
"structure": {
"storage": "centrifuge.structure.postgresql.Storage",
"update_interval": 60,
"settings": {
"url": "$DATABASE_URL"
}
},
"state": {
"storage": "centrifuge.state.redis.State",
"settings": {
"host": "<redis host>",
"port": <redis port>,
"password": "<redis password>"
}
}
}
git push heroku master
heroku logs --tail
Go to app-name.herokuapp.com and configure project settings as described in centrifuge.readthedocs.org
django-herokuify is released into the Public Domain.
Contribute to Centrifuge at github.com/FZambia/centrifuge.
Open pull requests to send updates for the heroku-centrifuge recipe.