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

  • SEARCH
  • Home
  • 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 604961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:05:40+00:00 2026-05-13T17:05:40+00:00

Just curious how people are deploying their Django projects in combination with virtualenv More

  • 0

Just curious how people are deploying their Django projects in combination with virtualenv

  • More specifically, how do you keep your production virtualenv’s synched correctly with your development machine?

I use git for scm but I don’t have my virtualenv inside the git repo – should I, or is it best to use the pip freeze and then re-create the environment on the server using the freeze output? (If you do this, could you please describe the steps – I am finding very little good documentation on the unfreezing process – is something like pip install -r freeze_output.txt possible?)

  • 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-05-13T17:05:41+00:00Added an answer on May 13, 2026 at 5:05 pm

    I just set something like this up at work using pip, Fabric and git. The flow is basically like this, and borrows heavily from this script:

    1. In our source tree, we maintain a requirements.txt file. We’ll maintain this manually.
    2. When we do a new release, the Fabric script creates an archive based on whatever treeish we pass it.
    3. Fabric will find the SHA for what we’re deploying with git log -1 --format=format:%h TREEISH. That gives us SHA_OF_THE_RELEASE
    4. Fabric will get the last SHA for our requirements file with git log -1 --format=format:%h SHA_OF_THE_RELEASE requirements.txt. This spits out the short version of the hash, like 1d02afc which is the SHA for that file for this particular release.
    5. The Fabric script will then look into a directory where our virtualenvs are stored on the remote host(s).
      1. If there is not a directory named 1d02afc, a new virtualenv is created and setup with pip install -E /path/to/venv/1d02afc -r /path/to/requirements.txt
      2. If there is an existing path/to/venv/1d02afc, nothing is done

    The little magic part of this is passing whatever tree-ish you want to git, and having it do the packaging (from Fabric). By using git archive my-branch, git archive 1d02afc or whatever else, I’m guaranteed to get the right packages installed on my remote machines.

    I went this route since I really didn’t want to have extra virtuenvs floating around if the packages hadn’t changed between release. I also don’t like the idea of having the actual packages I depend on in my own source tree.

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

Sidebar

Related Questions

Just curious how many people are actually running 2010 and what's your feedback so
I'm just curious how most people make their ASP.NET pages printer-friendly? Do you create
I really just am curious how people out there suppress their nerd rage while
I'm just curious as to what methods people are using to dynamically use larger
Just curious what people would name the file that contains the generic interface IRepository<T>
Just curious to see people's opinions: Has anyone thought about implementing the Flash player
I'm just curious if anyone knows if there's good reason why django's orm doesn't
I just realized static events exist - and I'm curious how people use them.
I wrote an iphone app and was just released.curious to See how many people
Just curious, if django has already proven that auto-admin can be done well, why

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.