I'm trying to do a relative import in App Engine using python. Here is my basic situation:
/
models.py
/mymodule/
test.py
mymodule.yaml
I'm trying to import models.py.. basically I have the same datastore models that are being using across different modules, so I was hoping to be able to import models.py from within test.py (or any other module).
How do relative imports work with App Engine? Thanks.
I'm trying to do a relative import in App Engine using python. Here is my basic situation:
app/
models.py
app.yaml
/mymodule/
test.py
mymodule.yaml
Create one file under app called __init__.py to transform your folder into a package and then you will be able to import like:
from app import models
I'm trying to do a relative import in App Engine using python. Here is my basic situation:
app/
models.py
app.yaml
/mymodule/
test.py
mymodule.yaml
I'm trying to import models.py.. basically I have the same datastore models that are being using across different modules, so I was hoping to be able to import models.py from within test.py (or any other module).
How do relative imports work with App Engine? Thanks.
Edit: My app.yaml file:
application: [my app name]
version: main
runtime: python27
api_version: 1
threadsafe: true
inbound_services:
- mail
builtins:
- appstats: on
handlers:
[my handlers]
libraries:
- name: webapp2
version: "2.5.1"
- name: jinja2
version: latest
- name: markupsafe
version: latest
- name: ssl
version: latest