PyCharm Integration

My guess is that creating a debugger for the client side code is difficult (python / skulpt / javascript / browser / …) and not worth, because usually the code on the client side is so little and simple that a few good old prints will do.

Debugging complex code that runs on the server side can be done with little effort by just running the server module locally (inside PyCharm) and having the form calling the functions defined in the uplink rather than in the server module.

You can have the same function defined on a server module and on an uplink module. When the uplink is running then its function will be called, when it is not running then the function with the same name defined in the server module will be called.

I haven’t used this technique in a long time because I haven’t worked with complex server modules in a long time, but I just did a quick test and everything seems to work fine.

I remember having some problems with some imports which I worked around using some try: import <from uplink> except: import <from server>.

I remember having also problems with performance: working with the database from here is slower than working from the server, so I wasn’t really comparing apples to apples. But this problem wouldn’t be solved by any PyCharm extension.

You will not be able to cover 100% of the Anvil functionalities (for example I couldn’t run SQL queries), but you will be able to debug complex modules inside PyCharm without problems.

In conclusion, I agree with you, I would really really really love to have an online debugger or one integrated with PyCharm, but I’m not expecting to see it any time soon. In the mean time there is a decent alternative worth using with complex server modules.

3 Likes