I'm building an app with Django and Django-Rest-Framework. The frontend js application makes API calls to the backend. It works well when I test it using python manage.py ruserver
but when i test it in a VM similar to my production environment, all API request get a 500 response.
In the error message, the Request URL does not correspond to the actual request that was made.
The actual request url looks like this:
But the error message says it is something like this:
http://127.0.0.1:8080/path/to/my/djoserapp/on/server/api/account/login/
The server is configured with nginx and daphne and the django version is 3.1
Here is my Nginx config :
server {
listen 80;
server_name _;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/app;
}
location /media/ {
root /home/app;
}
location / {
include proxy_params;
proxy_pass http://unix:/tmp/app.sock;
}
}
I don't know where to begin solving this and will greatly appreciate any help i could get.
Thank you