python - How to make a module accessible for all applications including GAE deployment process -


I have a python module which contains some utils that can use all of my GAE applications. I have created it myself, it's a separate folder and I sometimes want to update my code, make refactoring and more. Each application that I am creating can take usage functions from this module. Now I need to copy the module folder somewhere in an apparer and import its functions. This is a simple process, nothing fancy. When I make some updates to the module's code, I need to overwrite this module, if it has already been imported into the application. Then I just deploy the application with the GAE utility and fixes all the work. The question is whether there should not be too many copies of the module in every application, whenever I update some code in it, but keep a copy in one place and import it from there automatically? I know that I can copy the Python searches somewhere for the module. However, whenever I put it in the GAE environment, I still need to copy this module folder. Therefore, when I am on my local PC and I need to copy that folder, when I If I apply it then I need a copy of a module for all my applications. Is there a good and good solution? Thank you.

You can store your module in a directory outside of all your GAE applications, and then a symbolic link Can create. All GAE application directories for that directory will follow the epcegapp symbolic link inside directories. Quoted from:

If you create a symbolic link in the directory of a module in your Applications directory, then appcfg.py will follow the link and include the module in your app.

Comments