AppEngine #9

japboy opened this Issue Apr 5, 2011 · 8 comments


None yet
2 participants

japboy commented Apr 5, 2011

I'm trying to run Flask with Flask-Genshi on Google App Engine. I got an error below:

338, in _dispatch_by_prefix
    raise TemplateNotFound(filename, list(delegates.keys()))
TemplateNotFound: Template "static/templates/index.html" not found

I guess it's because of the template path is not passed correctly and it could be because of this plugin... Not sure though.

Running with:

  • Flask 0.6.1
  • Latest Flask-Genshi from its repository
  • Latest Genshi from its repository
  • Latest werkzeug from its repository
  • Latest jinja from its repository
  • Latest simplejson from its repository

Any idea? Thanks in advance.


dag commented Apr 5, 2011

Does it work outside of appengine? What is your code that tries to do the rendering? It looks like you're doing render_template("static/templates/index.html") which would actually look for the template in "templates/static/templates/index.html". Likely you want render_template("index.html"), then put it in "templates/index.html" next to the app, not inside "static/".

japboy commented Apr 6, 2011

Thanks for reply. Here's the current actual code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from django.utils import simplejson
from google.appengine.ext.webapp.util import run_wsgi_app
from flask import Flask
from flask import render_template
from flaskext.genshi import Genshi
from flaskext.genshi import render_response

app = Flask(__name__)
app.debug = True

genshi = Genshi(app)

def get_homepage():
    return render_response('index.html')

def main():

if __name__ == '__main__':

First of all, it worked outside of appengine. It also worked inside of appengine with Jinja2 return render_template('index.html') Currently I put templates templates/index.html next to the app.

File "/WORK_DIR/genshi/template/", line 338, in _dispatch_by_prefix
raise TemplateNotFound(filename, list(delegates.keys()))
TemplateNotFound: Template "index.html" not found

So the problem is appengine?

japboy commented Apr 6, 2011

Actually, it worked outside of appengine on Python 2.7...
Running it on Python 2.5 caused an error:

Process:         Python [503]
Path:            /opt/local/Library/Frameworks/Python.framework/Versions/2.5/Resources/
Identifier:      Python
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  Python [502]

I haven't installed Flask, Werkzeug, Jinja2, Genshi, and Flask-Genshi. I just put them under the appengine project directory (actually symlinked from source directory though). And removed appengine depended codes, and run python2.5 ./ and python2.7 ./

So... what's wrong with this?

japboy commented Apr 6, 2011


oh okay.... hm i actually run Genshi on my test appengine currently. it's not maintained rencently so i don't remember which revision i've useed though...
anyway thanks for your help! and i hope genshi works on appengine asap :(

japboy closed this Apr 6, 2011

dag reopened this Apr 6, 2011


dag commented Apr 6, 2011

Reopened because I changed the title.

dag closed this in 7bf70c9 Apr 10, 2011

dag reopened this Apr 17, 2011


dag commented Apr 17, 2011

Reopening because I'm hearing it does in deed run on GAE.

japboy commented Apr 18, 2011

wow that sounds interesting.
i'm using jinja2 instead though. i'' try later.

dag closed this in 5686cf0 Apr 18, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment