I'm new to Google App Engine and having the trouble that the app doesn't find my module. I get the error line 5, in <module> import foo as bar ModuleNotFoundError: No module named 'foo'. I have the current file structure as seen below (following a great tutorial for Flask).
The problem is that routes.py cannot import foo.py.
- app engine:/
- app
- static/css
- templates
- __init__.py
- foo.py
- routes.py
- app.yaml
- config.py
- main.py
- requirements.txt
- source-context.json
- app
Why is this? Are there special requirements for how files are structured on App Engine as this works locally?
Also, just to have things working I've tried having the code in the module foo in routes instead and the code works. But the code doesn't belong there and I want to structure it better but the app breaks when separating. In the end I would like to add directory "app engine":/app/libs (or else on recomendation) where I store my custom stuff.
EDIT (add code sample from routes.py)
from flask import render_template, flash, redirect, url_for
from app import app
from app.forms import LookupForm
import logging
import foo as bar
@app.route("/")
@app.route("/index")
def index():
return render_template("index.html")