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

Python

6206 readers
5 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
 

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
[–] [email protected] 4 points 1 month ago (2 children)

If A_WebApp is truly the python file and app is some python symbol then you should be able to make gunicorn in another venv and call your script as such: path/to/venv/bin/python gunicorn A_Web_App:app

[–] [email protected] 2 points 1 month ago (1 children)

Thank you ! it works !

Actually this is working :

path/to/venv/bin/gunicorn A_Web_App:app

Some other poster, claim it's dirty.. but which problems could it generate ? (if any)

Thanks all !!!!

[–] [email protected] 1 points 1 month ago

I don't think it's dirty if you manage your requirements across these environments with care, but I'd ask for what they mean