nginx+uwsgi+django, there seems to be some strange cache in uwsgi, help me

django, nginx, python, uwsgi

Solution

- uwsgi does not reload your code automatically, only development server does

- runserver is for debug purposes, uwsgi and nginx for production

- in production you can restart uwsgi by `service uwsgi restart` or via init.d script

- there is even better way to reload uwsg by using touch-reload

usually there is no need to cleanup `.pyc` files, it happens only when timestamps on files are wrong (I've seen it only couple times at my entire carieer)

Problem

This is uwsgi config: ``` [uwsgi] uid = 500 listen=200 master = true profiler = true processes = 8 logdate = true socket = 127.0.0.1:8000 module = www.wsgi pythonpath = /root/www/ pythonpath = /root/www/www pidfile = /root/www/www.pid daemonize = /root/www/www.log enable-threads = true memory-report = true limit-as = 6048 ``` This is Nginx config: ``` server{ listen 80; server_name 119.254.35.221; location / { uwsgi_pass 127.0.0.1:8000; include uwsgi_params; } } ``` The django works ok, but modifed pages can't be seen unless i restart uwsgi.(what's more, as i config 8 worker process, i can see the modified page when i press on ctrl+f5 for a while, seems that only certain worker can read and response the modified page, but others just shows the old one, who caches the old page? i didn't config anything about cache) I didn't config the django, and it works well with "python manager runserver ...", but havfe this problem when working with nginx+uwsgi. (the nginx and uwsgi are both new installation, i'm sure nothing else is configed here..)

Original source