Python code development and debugging

Hi there

I’m trying to create a new DocType (custom new one created) triggered in the on_update method of Sales Order python controller:

Please help me to

  1. how I can load the new changes made to the sales_order.py file? I was thinikng of kill and restart processes to force this. but that is not acceptable for any minimum update to code to restart everything

  2. how can I debug the changes made in the py files. just looking for low level output messages like a simple message in web.log

  3. I read from officila docs that wsgi gateway in using is werzeug instead of gunicor. how I can see it’s config? log files?

thanks

Hi @spect you should restart supervisor using sudo supervisorctl reload for reflecting the changes
You can use frappe.errprint for debuging
You should not make changes in files of erpnext instead you should create a new app and add docevents in hooks.py of that app

Regards
Ravindra Lakal
New Indictrans Technologies PVT LTD

Thanks Ravindra

I can see there a re on the forum a lot of precous informations in solution answers . May you suggest me a doc /manual/tutorial where I can find instructions on how to create this hoos.py file and what are the rules to follow and framework libraries conventions?

Many thanks

1 Like

https://frappe.github.io/frappe/user/en/guides/basics/hooks.html

many thanks really appreciated

Also check out:

And

1 Like