python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

injection is not working uWSGI + nginx + plotly dash + Flask

Open biyani701 opened this issue 2 years ago • 3 comments
trafficstars

i have used dependency_injector and injecting DynamicContainer. It is working fine on local machine or if i run it with python3 wsgi.py on ubuntu machine.

But when running it with nginx on ubuntu using uwsgi the dynamic injection does not work. Below is my

index.ini [uwsgi] module = wsgi master = true processes = 4 socket = index.sock chmod-socket = 777 vacuum = true die-on-term = true chdir = /opt/project env = .env debug = true logto = /var/log/uwsgi/uwsgi.log log-4xx = true log-5xx = true

Any guidance will be really helpful to troubleshoot.

biyani701 avatar Mar 21 '23 13:03 biyani701

I have exactly same issue while using gunicorn

dimentii avatar Mar 22 '23 10:03 dimentii

I have exactly same issue while using gunicorn

my bad had an initialization of container within if __name__ == '__main__': block

dimentii avatar Mar 22 '23 11:03 dimentii

I did the exact same mistake. Your hint helped me resolve my problem as well :-) I think there should be a better way to debug wiring issue as this looks like a black box.

biyani701 avatar Mar 23 '23 11:03 biyani701