Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> mkdir stack_camp/
- >>> cd stack_camp/
- # if the two lines below gives you error, use sudo
- >>> pip install virtualenv
- >>> pip install cookiecutter
- # Now grab the flask restful boilerplate and set it up
- >>> cookiecutter https://github.com/karec/cookiecutter-flask-restful.git
- project_name [restful_api]: restful_api
- app_name [myapi]: myapi
- Select use_celery:
- 1 - no
- 2 - yes
- Choose from 1, 2 (1, 2) [1]: 2
- >>> cd restful_api
- # always use a virtualenv, so you don't hate yourself later with conflicting global packages. seriously :)
- >>> virtualenv venv #make sure you are using python3
- >>> source venv/bin/activate
- >>> pip install -r requirements.txt
- # Heroku setup
- # Copy this line below and put it into a Procfile restful_api/ folder (root of your project)
- web: gunicorn restful_api.wsgi:app
- # Now, add this line to the bottom of your requirements.txt:
- gunicorn
- >>> heroku create
- # Git setup
- # At this point, go create a repo on your github.com account, and grab the repo URL.
- >>> git init
- >>> git add .
- >>> git commit -m "initial commit"
- >>> git remote add origin <github url>
- >>> git push origin master
- >>> git push heroku master
- # Now your project is deployed to both github AND Heroku!
- # See https://github.com/karec/cookiecutter-flask-restful for further details on how to login
- # to your API and call the initial REST API endpoint that they have already set up for you.
- # Project walkthrough
- # [Add info on how the project is structured]
- # On Heroku
- # Go to your new app, and click on "Deploy". Click on github, and type in your repo to connect it.
- # Click on Enable Automatic Deploys.
- # Now, whenever you push to your master branch, it will trigger Heroku to automatically build your
- # app and deploy it!
- # Go to configure add-ons. Add the following add-ons:
- # New Relic APM
- # Redis To Go
- # Heroku Scheduler
- # Adminium
- # Coralogix ($5/mo - not necessary until app is in production)
- # Scout APM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement