(2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. • pip install Fabric
..__init__.py ..local.py ..remote.py • Both files can quickly become quite big, so it's good to seperate them. • Import `from local import *` and `from remote import *` in __init__.py.
local.py or remote.py • Create fabric_settings.py for things that might differ from user to user • i.e. USER, PASSWORDS, or certain installation folders
fabric.api import env from fabric.colors import red from fabric.utils import abort def require_server(fn): @wraps(fn) def wrapper(*args, **kwargs): if env.machine is None: abort(red('ERROR: You must provide a server name to call this' ' task!')) return fn(*args, **kwargs) return wrapper