The Heroku Button for Shareabouts helps you set up a Shareabouts maps on reliable Heroku hosting in minutes. Here are the steps.
- Click the Heroku Button.
- Shareabouts will automatically be set up on Heroku
- Download the code locally to make configuration changes
- Deploy your code changes on Heroku
- Start collecting data!
If you don't already have one, create a Heroku account.
You'll need to add a credit card to your Heroku account in order to deploy. Shareabouts costs money to host each month. The API uses a Postgres database, which costs $50/mo. If you want your app to always be awake, it needs more than one dyno, which costs $34/mo. Later, you might want to scale up components, which will add to the cost. You can always scale up and down as needed, so you won't be taken by surprise. And if you delete the app soon after creating it, the monthly pro rated billing will be very low.
Set up the Heroku Toolbelt to easily deploy your edits back to Heroku.
Your computer should be set up with git
(comes with Heroku Toolbelt),
pip
, and virtualenv
.
Shareabouts requires python2.6 or greater.
Some familarity with the Heroku deployment process, git, and Github will be useful but is not required.
Click the button on the homepage of this repo.
If you get a timeout message around compiling the multi-pack, try running the process again.
After clicking the button, you'll be taken to a configuration screen on Heroku, listing out the settings that your Shareabouts map will be deployed with.
Optionally, choose an App Name. Your map will be available at App-Name.herokuapp.com, so add one unless you're planning to use a custom domain. Otherwise, Heroku will give it a name like warm-eyrie-7543.
Optionally, choose a region (defaults to United States).
Scroll down to see the various environment variables that will be set. You can change these later.
Scroll to the end and click "Deploy".
Wait while Shareabouts is configured. This can take a while.
Once your Shareabouts is set up, you'll see "Your app was successfully deployed."
Click View it to see your map. Congratulations!
Before going any further with setting up your map, log into the API server and change the default admin password.
Your API server is accessible at app-name.herokuapp.com/admin/ (you need the trailing slash).
User name is admin.
Password is admin -- change this!
Later, you can use the admin interface to add additional datasets.
Once your map is set up on Heroku, you'll want to configure it. For example, you might want to change the zoom, or style the icons differently. The easiest way to do this is to run a local version of Shareabouts, and make changes on the local version. Once you're happy, deploy those changes on Heroku so your live map is updated.
To download the code,
-
Login to your Heroku account locally
$ heroku login
-
Clone the repository
$ heroku git:clone -a app-name
where app-name is whatever you picked above, or the default assigned by Heroku.
-
Get your local version running
$ cd _app-name_ $ virtualenv env $ source env/bin/activate $ pip install -r requirements.txt
Once these steps complete sucessfully, you should be able to run the server with
```
$ src/manage.py runserver
```
The server will, by default, be started at http://localhost:8000/.
- Configure your map locally
The map won't be very useful till you configure it.
When you get to setting up your local settings, use the server you just deployed to Heroku. If the server name is shielded-tor-7768, by default your DATASET_ROOT
is shielded-tor-7768.herokuapp.com/api/v2/demo-user/datasets/demo-data until you make a new user and dataset.
-
After committing all your local changes, push them to Heroku
$ git push heroku master
Heroku will magically deploy the changes.
If you want to collaborate with others, push your project to Github.
Make a new repo on Github, and follow instructions there to "push an existing repository from the command line".