I would like to pass a few values from fabric into the remote environment, and I\'m not seeing a great way to do it. The best I\'ve come up with so far is:
Try using decorator
from fabric.context_managers import shell_env
from functools import wraps
def set_env():
def decorator(func):
@wraps(func)
def inner(*args, **kwargs):
with shell_env(DJANGO_CONFIGURATION=env.config):
run("echo $DJANGO_CONFIGURATION")
return func(*args, **kwargs)
return inner
return decorator
@task
@set_env()
def testme():
pass