- Clone github repository into a newly created folder:
$ git clone https://github.com/emunsing/flaskblockchain.git
- Create virtual environment by running
$ virtualenv env
- Set environment variables by running
$ source .env
- Install required Python packages with
$ pip install -r requirements.txt
- Associate heroku repository by running
$ git remote add heroku git@heroku.com:flaskblockchain.git
- Run a local server with
$ python otters.py
- Go to http://localhost:5000 and see results!
Needed for Flask app:
- flaskblockchain.py: Needs to run the app, and provide handlers for http requests
- Config.py: Defines environment variables for different execution environments, to turn on and off different functionalities or logging levels. Not strictly required, but useful for having both development and deployment environments
- .env: Source this to set environment variables
- requiremens.txt: Generated by
pip freeze > requirements.txt
Required for Heroku:
- runtime.txt: Specify the Python runtime environment
- Procfile: Required by Heroku to indicate the type of dyno to spin up, and what to run
When creating a new app...
- In addition to installing Flask and other requirements, be sure to install
This assumes that you're using the command line:
- Create app with
$ heroku create myawesomeapp
where your actual app name replacesmyawesomeapp
- Set environment with
$ heroku config:set APP_SETTINGS=config.HerokuConfig
- Set dyno scale with
$ heroku ps:scale web=1