On the production server (nginx + gunicorn), after changes in the files, sometimes the changes are displayed, sometimes they are not displayed. After restarting the server, everything works correctly.

I thought it might be related to caches and tried different options (disabling caches, cleaning caches, etc.), but the problem remained. Also tried deleting the __pycache__ folders in different project directories, but that didn't help either

1

There are 1 best solutions below

0
On

Restarting the server is required if you are making changes to the code, because, when the application is started the project code/files is loaded into the memory and any changes to it will not reflect until the server restarts.

If you are using supervisor to manage the processes, you can restart the server by

$ sudo supervisorctl restart <process_name>