pipenv: deployment workflow

后端 未结 5 818
独厮守ぢ
独厮守ぢ 2021-02-01 19:17

I am thinking about switching from pip & virtualenv to pipenv. But after studying the documentation I am still at a loss on how the creators of pipenv structured the deploy

5条回答
  •  甜味超标
    2021-02-01 19:27

    Just do this:

    mkdir .venv
    pipenv install
    

    Explanation:

    pipenv checks your project directory for a sub directory named .venv. If it finds it, then pipenv creates a local virtual environment (because then it sets automatically PIPENV_VENV_IN_PROJECT=true)

    So now if you want you can either activate the virtual environment with:

    source .venv/bin/activate
    

    Or config you app.conf for gunicorn with something like this:

    exec /path/to/.venv/bin/gunicorn myapp:app
    

提交回复
热议问题