A
A
Alexander Alexandrov2015-06-29 17:20:56
JavaScript
Alexander Alexandrov, 2015-06-29 17:20:56

Why does this happen with uwsgi?

Please help me figure it out, for the first time I'm posting a django application, I don't understand what I'm doing.
Locally with python manage.py runserver everything works as it should.
But in conjunction with nginx + uwsgi + django, the page seems to be cached.
Those. if you follow the link bit.ly/1NpYrmt , click "buy", and then refresh the page, the amount in the basket alternates with the previous value.
What should be added to the config to avoid this behavior?
upd: nginx-conf:

upstream roofracks{
server unix:///tmp/roofracks.sock; # for a file socket
#server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
server {
listen 80;
server_name http://www.xxx.ru;
location / {
proxy_pass http://localhost:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
#uwsgi_pass roofracks;
include /etc/uwsgi/uwsgi_params;
}
location /static {
alias /var/www/static;
}

uwsgi.ini

home=/path/project/env
http = :8001
chdir=/path/project/roofracks
master=True
disable-logging=True
vacuum=True
socket = /tmp/%n.sock
#pidfile=/path/project/pids/ project.pid
max-requests=5000
#socket=127.0.0.1:49001
processes=2
#module = /path/project/first/uwsgi_params
#pythonpath=/path/project/env
env=DJANGO_SETTINGS_MODULE=roofracks.settings
#module = django .core.handlers.wsgi:WSGIHandler()
module = roofracks.wsgi:application
touch-reload=/tmp/roofracks.txt

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Kitaev, 2015-06-29
@deliro

By default, nothing is cached. There is an error in the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question