I have 3 appengine modules lets say modA (default module-contains app.yaml), modB and modC, which share datastore entities and some utility functions and external libs in an 'common' directory as shown in the below:
- modA
- app.yaml
- appengine_config.py
- modB
- modB.yaml
- appengine_config.py
- modC
- modC.yaml
- appengine_config.py
- common
- __init__.py
To share 'common' among the modules, I created appengine_config.py file with the following code:
#!/usr/bin/env python
import sys
import os
import logging
logging.info("LOADING CONFIG FILE")
PARENT_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(PARENT_DIR, 'common'))
logging.info(sys.path)
In the console it shows the 'common' in sys.path but it still fails to recognize the module when using import statements.
Please let me know on how to fix this. Also is there a better way to do this ?