I have the error:
BadRequestError: app "dev~myapp" cannot access app "s~myapp"'s data
Which is similar, but the opposite way around to this question.
The answer doesn't seem to apply to my app though (even trying to turn it on its head) - I have only one app, and I am not using the remote API, and I am not using urlsafe keys, and all my key properties are db.ReferenceProperty
s, or db.ListProperty( db.Key )
s.
The error comes in the first line of the template I attempt to render:
File "/.../template.html", line 1, in top-level template code
{% extends "page.html" %}
If I comment out that line, then the error occurs:
File "/.../template.html", line 1, in top-level template code
<!--{% extends "page.html" %}-->
Which suggested to me that the error is in actually loading the template with Jinja, prior to applying template magic.
template.html
is rendered with variables that are entity lists (not Query
objects, but [e for e in queryObject]
s). If I replace these with an empty list, the page renders fine.
My dev server's datastore is populated with a backup from the production server, but I have not had a problem accessing these entries until now. I am getting these entity lists as follows:
@staticmethod
def gql(query, *a, **kw):
keys = super(Model, Model).gql(query, *a, **kw).run(keys_only=True)
cached = []
for key in keys:
inCache = memcache.get('Model_'+str(key))
if inCache:
cached.append(inCache)
else:
fromDB = Model.get(key)
memcache.set('Model_'+str(key), fromDB)
cached.append( fromDB )
return cached
I can print the results out with logging
prior to rendering with Jinja fine. It's also fine in the interactive console.
Why does this become an attempt to access another app's data, and raise this exception when Jinja renders it?