Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8932775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:23:08+00:00 2026-06-15T09:23:08+00:00

I have a local development environment that relies heavily on system environment variables (it

  • 0

I have a local development environment that relies heavily on system environment variables (it follows the Heroku 12-factor app model), and I currently set these using a shell script. The shell script also sets up git remotes, and activates the virtualenv environment, and I’d like, if possible, to move all this to a Fabric command (or series of commands), as we are using Fabric for a bunch of other stuff, and I’d like to retire the shell scripts.

Running local('export FOO=bar') doesn’t work:

$ fab set_default_env_vars
Using fabfile '/home/hugo/Projects/test/fabfile.py'
[localhost] local: export FOO=bar

Done.

$ echo $FOO

$

Is this possible – and if so, how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:23:09+00:00Added an answer on June 15, 2026 at 9:23 am

    You can use fabric.context_managers.shell_env to export a variable to bash for your shell and all subshells spawned from it – but those variables won’t persist beyond the shell that they were defined for (so you can’t set environmental variables for the parent shell from a fabric script the way your example has it).

    You can set up a bash script that you source for your local environment that is identical to what you would add to ~/.profile in your production slug (in its keys, not necessarily its values) and use fabric.context_managers.prefix to source that file before you run your local commands.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our setup as follows: We have a local development server running Ubuntu, with a
Currently i have a node.js and socket.io application in development on my local machine
I'm using the Windows Launcher development environment for Google App Engine. I have downloaded
I mucked around my development environment enough that now I have to restart my
I'm trying to configure my local development environment to read .less files so that
I have my site mydomain.local on my local development machine, which uses a local
I have a really weird issue here. I'm using my local development server right
I have a little problem in my query. My database at my local development
I have configured my application to use the Service configuration Local in the development
I have worked within a web development company where we had our local machines,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.