12
submitted 1 month ago* (last edited 1 month ago) by SpongeB0B@programming.dev to c/python@programming.dev

Hi,

I use gunicorn in my venv

I have quite few venv that run gunicorn.

I would like to reuse gunicorn for other venv

I launch my web application like this

#PWD = venv dir
source ./bin/activate
gunicorn A_WebApp:app
#A_WebApp is my python file A_WebApp.py

I supposes that gunicorn is a shell program ? if yes I should use $PATH ?
or gunicorn is a Python program only ? and then what I should do to use gunicorn in another venv ?

Thanks.

you are viewing a single comment's thread
view the rest of the comments
[-] walthervonstolzing@lemmy.ml 5 points 1 month ago* (last edited 1 month ago)

Wouldn't enabling the --system-site-packages flag during venv creation do exactly what the OP wants, provided that gunicorn is installed as a system package (e.g. with the distro's package manager)? https://docs.python.org/3/library/venv.html

Sharing packages between venvs would be a dirty trick indeed; though sharing with system-site-packages should be fine, AFAIK.

[-] onlinepersona@programming.dev 2 points 1 month ago

Hadn't considered that. It might be the solution @SpongeB0B@programming.dev is looking for. Good shout.

Anti Commercial-AI license

this post was submitted on 08 Aug 2024
12 points (92.9% liked)

Python

6187 readers
3 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS