Define Common Files For GAE Projects
Solution 1:
The reason for the error you see is that nothing above the module/service dir (or app dir for single module apps) is uploaded to GAE during deployment.
You can symlink the necessary file(s) inside your app dirs, see https://stackoverflow.com/a/34291789/4495081. The deployment utility knows to follow the symlink and include the common folder package in the deployment.
I would suggest making the common folder a package (add a __init__.py
file) then vendor it in inside each application but instead of copying/installing the code just symlink the common code dir inside the lib
dir.
Then you don't need to fiddle with the path manually, in your app you'd just use the classes like this (assuming for example that MyClass
comes from common_folder/class.py
):
from common_folder.class import MyClass
Post a Comment for "Define Common Files For GAE Projects"