How can I install a ruby gem (foreman) in a python virtualenv for my django project? And do I need to?

StackOverflow https://stackoverflow.com/questions/8808439

Question

I am trying to follow the instructions here: http://honza.ca/2011/06/install-ruby-gems-into-virtualenv

However, I cannot find the postactivate script on my system. This link: http://bruno.im/2011/sep/29/streamline-your-django-workflow/ suggests that there should be a file called ~/.virtualenvs/postactivate, but it is not on my system.

I have installed virtualenv and have set up a django app with the following structure:

django-project/
    .git/
    .gitignore
    blossom/              # top of my django project
        __init__.py
        blossom-sqlite3-db
        manage.py
        onora/            # my actual django app
            __init__.py
            models.py
            tests.py
            views.py
        settings.py
        urls.py
    requirements.txt
    virtualenvironment/
        .Python@ -> /System/Library/Framework... 2.7
        bin/
        include/
        lib/

I would now like to add gunicorn to my requirements.txt file, install it with pip, and then create a procfile with the following line (as per heroku instructions at http://devcenter.heroku.com/articles/django#using_a_different_wsgi_server):

web: python blossom/manage.py run_gunicorn -b "0.0.0.0:$PORT" -w 3

My understanding is that in order to use a procfile on my local system, I will have to install a ruby gem called foreman.

I have a couple questions. First, do I need to install foreman in this virtual environment at all? I need the virtual environment so that I can keep everything neatly contained for deploying to heroku. The foreman gem is only for running things locally, if I understand what's going on correctly. So perhaps I don't need foreman installed in the virtual environment. Second, if it would be better for me to install foreman in the virtual environment, how can I find the postactivate file that I am supposed to have?

Thanks.

Was it helpful?

Solution

Postactivate is part of virtualenvwrapper, a tool that builds on top of virtualenv.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top