React Native app fails to reach endpoints on python virtualenv, but succeeds with global python env
Previously when running global python I was doing manage.py runserver 0.0.0.0:8000. Turns out I had to use my actual machine's IP address with the virtual env. Not sure why it works differently in that way, but it does.
I had been building my React Native app for a long time using a global python environment, which I know is bad form, so I decided to create a virtualenv.
But now when I activate the virtualenv and run the server, none of my api endpoints are reachable (I'm using django btw). Instead, the network call doesn't return for a very long time and then comes back with the error "Network Request Failed". But if I deactivate the virtualenv and go back to global python and run the server, everything works fine.
I've seen this "Network Request Failed" error before during times where I've forgotten to turn the server on, so I know it indicates that the server is unreachable.
Here's one last weird aspect though. If I activate the virtualenv and turn on the server and then type the url to an endpoint into the browser, it successfully reaches the browsable django api for the endpoint. So it seems to be set up fine except that the app for whatever reason can't communicate with it. Very bizarre.