I'm using Django 1.0, so it may be that your advice doesn't apply to
me. In case it does, I tried following what you're saying.
Unfortunately, I'm find it quite difficult to understand what you
think the problem is. I get your point about how there's some config
in settings.py that sets what template loaders to use. I think what
you're saying is that some other file is clobbering that setting.
Specifically, you seem to be saying that if the following line exists
in one of my files, I'll get sporadic TemplateDoesNotExist errors:

from google.appeninge.ext.webapp import template

I did a grep on my project, and I don't have that line anywhere.

On May 17, 1:13 pm, Roger Hu <[email protected]> wrote:
> This import is causing massive headaches on App Engine deployments
> with TemplateDoesNotExist sporadic messages.  Assuming you have Django
> 1.1 setup correctly, the global_settings.py file will setup
> TEMPLATE_LOADERS to load from both the project dir (/templates) as
> well as any INSTALLED_APPS dir.  But we noticed sporadic issues with
> App Engine reporting the issue:
>
> TemplateDoesNotExist: Tried [u'/base/data/home/apps/
> myapp1234/1-2-2-8.341999523263263665/templates/volunteer-11.html']
>
> The reason?
>
> By default, Django has these two TEMPLATE_LOADERS defined in its
> global settings (defined in conf/global_settings.py):
>
> TEMPLATE_LOADERS = (
>     'django.template.loaders.filesystem.load_template_source',
>     'django.template.loaders.app_directories.load_template_source',
> )
>
> The second line tells Django to try all the INSTALLED_APPS dirs
> whenever attempting to render an HTML template.   For instance, we do
> not need to specify volunteer-11.html because it will try to look
> inside ragendja/templates, accounts/templates, and civio/templates, in
> the order defined by INSTALLED_APPS inside settings.py:
>
> INSTALLED_APPS = (
>     'django.contrib.auth',
>     'django.contrib.sessions',
>     'django.contrib.admin',
>     'ragendja',
>     'accounts',
>     'civio'
> )
>
> If you accidentally import this line in your Python code,
>
> from google.appengine.ext.webapp import template
>
> The GAE reconfigures TEMPLATE_LOADERS inside
> google.appengine.ext.webapp.template:
>
> import django.conf
> try:
>   django.conf.settings.configure(
>     DEBUG=False,
>     TEMPLATE_DEBUG=False,
>     TEMPLATE_LOADERS=(
>       'django.template.loaders.filesystem.load_template_source',
>     ),
>   )
>
> +#from google.appengine.ext.webapp import template
>
> The result is TemplateDoesNotExist messages that may or may not occur.
>
> 3. If you are using Django 1.1, you must be careful that you're not
> importing google.appengine.ext.webapp import template.  The solution,
> I believe, is to simply remove all webapp dependency imports:
>
> perl -pi.bak -e "s/^from google\.appengine\.ext\.webapp(.*)/#from
> google.appengine.ext.webapp\1/g" *.py
>
> We're still confirming that these changes will resolve the issue, but
> it seems to explain the problem we have been having on Django 1.1.
>
> Roger
>
> On May 10, 12:25 pm, Fredrik Bonander
>
>
>
> <[email protected]> wrote:
> > I have a similar problem. When I updated to django 1.1 I get 
> > TemplateSyntaxError: Template u'../index.html' cannot be extended, because 
> > it doesn't exist.
>
> > It seams that the problem lies in that the TEMPLATE_DIRS is not set wrong. 
> > But I don't know how set in as a relative path.
>
> > Anyone successfully used django 1.1 in GAE?
>
> > ..fredrik
>
> > On May 8, 2010, at 2:27 PM,allyourcodewrote:
>
> > > I think the problem is that my TEMPLATE_DIRS gets cleared at some
> > > point, even though my app doesn't do that, at least not directly. My
> > > guess is that this is happening somewhere in the SDK or Django helper
> > > to implement the admin pages, but I can't tell which piece is doing
> > > the manipulation :/.
>
> > > I'll try to upgrade my SDK, but again, when I tried this before, my
> > > app ended up dead in the water (forget what issues I was running into
> > > before).
>
> > > On May 7, 2:08 am, "Nick Johnson (Google)" <[email protected]>
> > > wrote:
> > >> Hi,
>
> > >> It's impossible to suggest what might be wrong without seeing the code in
> > >> question. It looks like you're probably running into problems with 
> > >> relative
> > >> or absolute paths, or your css file is marked as static in your app.yaml.
>
> > >> You should definitely upgrade your SDK - 1.3.3 is the latest version, and
> > >> 1.2.7 is very much out of date.
>
> > >> -Nick Johnson
>
> > >> On Fri, May 7, 2010 at 1:00 AM,allyourcode<[email protected]> wrote:
> > >>> Hi,
>
> > >>> I'm having a problem developing my GAE application. It's been reported
> > >>> as issue 464 on the GAE issue tracker, but it's not getting any
> > >>> attention, due to difficulties with reproducing the issue; hence, I'm
> > >>> turning to the GAE group to look for support.
>
> > >>> Restarting the dev server temporarily gets rid of the problem, but it
> > >>> keeps coming back. I'm worried this problem will come up in
> > >>> production, but we haven't released our app yet, so I've never had a
> > >>> chance to see how it works in production.
>
> > >>> One symptom of the problem is if you go to
> > >>>http://localhost:8000/_ah/admin/interactive
> > >>> and enter a correct program, and it hit "Run Program", the following
> > >>> output is (sporadically) generated:
>
> > >>> Traceback (most recent call last):
> > >>>  File "c:\Program Files\Google\google_appengine\google\appengine\ext
> > >>> \webapp\__init__.py", line 507, in __call__
> > >>>    handler.get(*groups)
> > >>>  File "C:\Program Files\Google\google_appengine\google\appengine\ext
> > >>> \admin\__init__.py", line 737, in get
> > >>>    self.generate('datastore.html', values)
> > >>>  File "C:\Program Files\Google\google_appengine\google\appengine\ext
> > >>> \admin\__init__.py", line 131, in generate
> > >>>    self.response.out.write(template.render(path, values,
> > >>> debug=_DEBUG))
> > >>>  File "c:\Program Files\Google\google_appengine\google\appengine\ext
> > >>> \webapp\template.py", line 80, in render
> > >>>    t = load(template_path, debug)
> > >>>  File "c:\Program Files\Google\google_appengine\google\appengine\ext
> > >>> \webapp\template.py", line 108, in load
> > >>>    template = django.template.loader.get_template(file_name)
> > >>>  File "<app_root>\django.zip\django\template\loader.py", line 81, in
> > >>> get_template
> > >>>  File "<app_root>\django.zip\django\template\loader.py", line 89, in
> > >>> get_template_from_string
> > >>>  File "<app_root>\django.zip\django\template\__init__.py", line 166,
> > >>> in __init__
> > >>>  File "<app_root>\django.zip\django\template\__init__.py", line 187,
> > >>> in compile_string
> > >>>  File "<app_root>\django.zip\django\template\__init__.py", line 283,
> > >>> in parse
> > >>>  File "<app_root>\django.zip\django\template\loader_tags.py", line
> > >>> 169, in do_extends
> > >>>  File "<app_root>\django.zip\django\template\__init__.py", line 283,
> > >>> in parse
> > >>>  File "<app_root>\django.zip\django\template\loader_tags.py", line
> > >>> 147, in do_block
> > >>>  File "<app_root>\django.zip\django\template\__init__.py", line 283,
> > >>> in parse
> > >>>  File "<app_root>\django.zip\django\template\loader_tags.py", line
> > >>> 187, in do_include
> > >>>  File "<app_root>\django.zip\django\template\loader_tags.py", line
> > >>> 102, in __init__
> > >>>  File "<app_root>\django.zip\django\template\loader.py", line 80, in
> > >>> get_template
> > >>>  File "<app_root>\django.zip\django\template\loader.py", line 73, in
> > >>> find_template_source
> > >>> TemplateDoesNotExist: css/datastore.css
>
> > >>> When I restart the server, visit some pages in my app in another
> > >>> window, and go back to the original window containing the script was
> > >>> trying to run in the Interactive Console, I'm able to run it
> > >>> successfully without modification (this is how I know the program is
> > >>> correct).
>
> > >>> Here are my versions:
>
> > >>> GAE SDK 1.2.7
> > >>> Django 1.0
> > >>> GAE Django Helper r95
> > >>> Python 2.5.4
> > >>> Windows XP Home Edition SP3
>
> > >>> I know there's a new version of the SDK, but when I tried upgrading,
> > >>> my app stopped working, so I reinstalled version 1.2.7, which is
> > >>> (otherwise) working fine for me.
>
> > >>> I know other people have experienced this. Has anyone found a
> > >>> solution?
>
> > >>> Thanks,
>
> > >>>allyourcode
>
> > >>> --
> > >>> You received this message because you are subscribed to the Google 
> > >>> Groups
> > >>> "Google App Engine" group.
> > >>> To post to this group, send email to [email protected].
> > >>> To unsubscribe from this group, send email to
> > >>> [email protected]<google-appengine%2Bunsubscrib
> > >>>  [email protected]>
> > >>> .
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/google-appengine?hl=en.
>
> > >> --
> > >> Nick Johnson, Developer Programs Engineer, App Engine Google Ireland 
> > >> Ltd. ::
> > >> Registered in Dublin, Ireland, Registration Number: 368047
> > >> Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration 
> > >> Number:
> > >> 368047
>
> > >> --
> > >> You received this message because you are subscribed to the Google 
> > >> Groups "Google App Engine" group.
> > >> To post to this group, send email to [email protected].
> > >> To unsubscribe from this group, send email to 
> > >> [email protected].
> > >> For more options, visit this group 
> > >> athttp://groups.google.com/group/google-appengine?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Google App Engine" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to 
> > > [email protected].
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/google-appengine?hl=en.
>
> > --
> > Fredrik Bonander
> > [email protected]
> > +46 70 943 5441
>
> > - the infinite power of the creative mind -
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google App Engine" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to ...
>
> read more »

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to