Advertisement
jeffdh5

Untitled

Dec 29th, 2018
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. >>> mkdir stack_camp/
  2. >>> cd stack_camp/
  3. # if the two lines below gives you error, use sudo
  4. >>> pip install virtualenv
  5. >>> pip install cookiecutter
  6.  
  7. # Now grab the flask restful boilerplate and set it up
  8. >>> cookiecutter https://github.com/karec/cookiecutter-flask-restful.git
  9. project_name [restful_api]: restful_api
  10. app_name [myapi]: myapi
  11. Select use_celery:
  12. 1 - no
  13. 2 - yes
  14. Choose from 1, 2 (1, 2) [1]: 2
  15.  
  16. >>> cd restful_api
  17. # always use a virtualenv, so you don't hate yourself later with conflicting global packages. seriously :)
  18. >>> virtualenv venv #make sure you are using python3
  19. >>> source venv/bin/activate
  20. >>> pip install -r requirements.txt
  21.  
  22. # Heroku setup
  23. # Copy this line below and put it into a Procfile restful_api/ folder (root of your project)
  24. web: gunicorn restful_api.wsgi:app
  25.  
  26. # Now, add this line to the bottom of your requirements.txt:
  27. gunicorn
  28.  
  29. >>> heroku create
  30.  
  31. # Git setup
  32. # At this point, go create a repo on your github.com account, and grab the repo URL.
  33. >>> git init
  34. >>> git add .
  35. >>> git commit -m "initial commit"
  36. >>> git remote add origin <github url>
  37. >>> git push origin master
  38. >>> git push heroku master
  39. # Now your project is deployed to both github AND Heroku!
  40. # See https://github.com/karec/cookiecutter-flask-restful for further details on how to login
  41. # to your API and call the initial REST API endpoint that they have already set up for you.
  42.  
  43. # Project walkthrough
  44. # [Add info on how the project is structured]
  45.  
  46. # On Heroku
  47. # Go to your new app, and click on "Deploy". Click on github, and type in your repo to connect it.
  48. # Click on Enable Automatic Deploys.
  49. # Now, whenever you push to your master branch, it will trigger Heroku to automatically build your
  50. # app and deploy it!
  51.  
  52. # Go to configure add-ons. Add the following add-ons:
  53. # New Relic APM
  54. # Redis To Go
  55. # Heroku Scheduler
  56. # Adminium
  57. # Coralogix ($5/mo - not necessary until app is in production)
  58. # Scout APM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement