Blocking Dependencies

Is there a way to choose which parts of an app can be imported by another? Or choose to block/hide certain bits of an app from being imported?

For instance, I might want one server module to be allowed but not another (as it might contain a function to decrypt a load of data which is only pertinent to the dependency app and not the dependant one).

As far as I can see at the moment it is all or nothing.

Yeah; as a rule, Python is not good at segregating one part of a program from another. Once someone can call your functions, they can mess with your code in all sorts of ways - it’s not a security boundary you can defend.

If you want to make something separate, make it a separate dependency and only import it into the apps that need it. Remember, you can import server modules in one app from another app - and you can even call server functions in a dependency from a dependent app! If you want your server functions not to be visible in the autocompleter in dependent apps, you can start their names with an underscore (_).

1 Like

Thought so, even as I was typing it. It was of questionable value anyway - I was overthinking something.

Cheers.