Code Monkey home page Code Monkey logo

developer-unicorns-february-twenty-fourth's Introduction

#Building Web Apps Fast ##Flask,Heroku, Syncano

###Heroku

Setting up Heroku:

#####Installin' Stuf'

#####Figurin' to Configure some things

  • create a requirements.txt file --> pip freeze > requirements.txt

    • Unless you are on ubuntu. Then run this pruner after you do pip freeze > requirements.txt
    • Or make sure you set up a virtualenv and use the pip within your virtualenv
  • create a Procfile

    • For most simple web apps you'll only need: web: gunicorn app:app
      • in general Procfile's have the following form: <process type> : <command>, for more info check this out
    • For more advance web apps check out the foreman reference and an interesting example with web sockets
    • concurrency with foreman:
      • Procfile: ``` web: gunicorn web:web

          worker: python scraper.py
        ``` 
        
      • terminal command: foreman start -c web=1, worker=2

  • create a runtime.txt file

    • file contents: python-2.7.6
    • There is a known bug with gevent and python-2.7.9 that breaks ssl.

#####Terminal time

  • push your project up to git:

    • git init
    • git add -A
    • git commit -a -m "first commit"
    • git remote add origin [email protected]:[user-name]/[repo name].git
    • git push -u origin master
  • push your project to heroku:

    • git push heroku master
    • heroku ps:scale web=1
    • heroku open

###Syncano

  • setting environment variables - locally

    • Ubuntu - edit .bashrc (you can get there by typing cd ~)
    • set instance name: export SYNCANO_INSTANCE_NAME=[instance name] AND export PATH="$SYNCANO_INSTANCE_NAME:$PATH" to the end of the file.
    • set api key: export SYNCANO_API_KEY=[api key] AND export PATH="$SYNCANO_API_KEY:$PATH" to the end of the file.
  • setting environment variables - on heroku:

    • heroku config:set SYNCANO_INSTANCE_NAME=[instance name]
    • herok config:set SYNCANO_API_KEY=[api key]

###Flask

developer-unicorns-february-twenty-fourth's People

Contributors

ericschles avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.