I will spell various notes from the perspective of Ruby.
pip, pip3
Something like gem,
The guy that comes with python3 is pip3
virtualenv
Something like Bundler
$ pip3 install virtualenv
Create an isolated environment with a command like bundle init
$ virtualenv venv
Type a command like bundle exec
$ source venv/bin/activate
Flask
Something like Sinatra
$ pip install flask
Gunicorn
Web server, something like unicorn
$ pip install gunicorn
Let's say it's named test_app
.
$ mkdir test_app; cd test_app
$ touch main.py Procfile
main.py
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello World!'
Procfile
web: gunicorn main:app --log-file=-
$ foreman start
Easy ...
$ pip freeze > requirements.txt
git
$ git init
$ echo 'venv\n*.pyc' > .gitignore
heroku
$ heroku create test-app
$ git push heroku master
$ heroku open
later
http://flask.pocoo.org/docs/0.10/
Recommended Posts