0๐
I have found a solution for this case. For some reason, POST methods were not allowed even though you didnโt have to log in o register to send a contact email. The settings.py of my Django backend app was good. I didnโt specify there anything related to being authenticated. I was able to solve that by adding AllowAny to my views that use POST method. In your views.py first add:
from rest_framework.permissions import AllowAny
Then, you add:
@api_view(['POST'])
@permission_classes([AllowAny])
def contact(request):
So, I am not sure why this is working that way. Even after that, I tried deleting it and it worked well without AllowAny.
1๐
I suppose that its an Nginx config problem.
This question is related and may help:
POST request not allowed โ 405 Not Allowed โ nginx, even with headers included
Regarding that it works on your local, please Dockerize your app.