I’m updating a Django 1.7 application running on a Linux server with Nginx.
I’ve updated my views.py and added some data to the payload sent to populate the template, to present in the resulting web page, but there’s no update to the data being sent to the template.
I made changes to the template files (html) to see if anything at all changes, and yes, the changes to the template were shown in the resulting web page.
I figured that the -py files were being cached by something (web server maybe?) so I’ve restarted the nginx service again and again, but no change.
The .pyc files did not update, so I removed them, restarted nginx, but no new .pyc files were generated.
I ran python -m compileall
in python 2, and new .pyc files were created, but the resulting web page still wasn’t being updated.
Bottom line… No changes made to my .py files are affecting the application being run. Changes to template files, javascript files and so on… no problem at all. Everything byt the .py files seem to work.
I don’t really know what more to present here to give more hints about my problem, so please ask.
2
Answers
As @Marat pointed out in the comments, what I needed to do was to restart the uwsgi service to make my changes take effect.
To update your django files, run the following command in your terminal