Custom Server Script Code not updating after save


I need help please. I created a new doctype using the custom app I created, then change the controller method in the py file to do something but whenever I update the code to change the functionality and saved it, I noticed that it was still the old code being executed.

I tried doing bench migrate, bench clear-cache, bench restart, refreshing and reloading the page and even trying different browser and mobile browser but with no luck.

I also noticed this error while checking the “inspect view source”. Not sure though if its connected to the issue i am facing.

Currently using Frappe Framework: v13.20.1 (version-13) and Bench v5.7.5


Hello @myrassel,

It will help to diagnose the issue if you show the controller method that is supposed to execute the logic.

Also please share the output you expect, and the output you’re getting.

there is no such command bench restart, if in developer mode, the python code change will be auto reloaded, if in production mode, need to run sudo supervisorctl restart all.

in rare case, you can try to delete the pyc or pyd file to force system recompile py and reload.

Thank you @szufisher! It works like charm now. Deleting the .pyc did the trick. One last question, is there any bench command that will delete this files?

Currently in production mode BTW but developer mode was set in set-config file, auto-reload is not working as mentioned. Is there any command to force that?