5👍
Since I asked this question over 5 years ago, I might be wrong.
But I’m gonna answer it now as best I can, since all the answers coming up seem to be far off from my solution(s).
I recently used Django again for a few projects and had a similar problem.
List of what I was doing wrong:
- Had uwsgi installed in the virtualenv as well as globally on the system
- Wrong path to the app in the uwsgi-config
- Wrong path to the virtualenv in the uwsgi-config
- Permissions for the socket-file for connecting uwsgi and nginx were set incorrectly
That’s all I can think of, what I’ve been doing wrong, back in the day.
I hope this helps all of you, who struggle with the setup.
- Django REST Framework – Set request in serializer test?
- Renaming a Django superclass model and updating the subclass pointers correctly
11👍
You can set DEBUG = True
on your server, restart uwsgi
service and check the django
‘s debug output in your browser. The fact you don’t see any errors with django
‘s development server doesn’t mean the error is related to nginx
or uwsgi
services.
1👍
Okay so I got this same error but I finally figured it out. (At least for me). I pray to god this works for you because I wasted a day on this.
If you’re like me you used: http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html as a tutorial to get the basic setup. I got uwsgi to work over http and it seemed to work over tcp socket. As soon as I tried to hook up nginx, I kept getting 400 errors. It specifically says create a file name my_site.conf and link that to sites-enabled. Well if you check sites-enabled you should see a file named default. Notice this file isn’t named default.conf. Try renaming my_site.conf to my_site and make sure to re-link.
TDLR: Unlink my_site.conf. Rename my_site.conf to my_site. Link my_site to sites-enabled
- Django request.POST does not contain the name of the button that submitted the form
- Many to many relationships with additional data on the relationship
- Raw_id_fields for modelforms
- Getting error cannot import name 'six' from 'django.utils' when using Django 3.0.0 latest version
- Django and NoSQL, any ready-to-use library?