Skip to content

Instantly share code, notes, and snippets.

@LuanP
Created October 22, 2015 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LuanP/2a512109c5e16733eb67 to your computer and use it in GitHub Desktop.
Save LuanP/2a512109c5e16733eb67 to your computer and use it in GitHub Desktop.
@task
def bootstrap():
"""Bootstrap machine to run fabric tasks"""
with settings(user=env.user):
bashrc = run('cat ~/.bashrc')
if 'DJANGO_SETTINGS_MODULE' not in bashrc:
default_settings = 'project_one.settings.{0}'.format(
env.environment
)
run('echo "export DJANGO_SETTINGS_MODULE={0}" >> ~/.bashrc'.format(
default_settings))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment