views:

22

answers:

1

Hi everyone.

I'm trying to read a line from a static file and insert it into a template in Google App engine using the Webapp framework. However, the line does not render, not matter what I try. Is there something that I'm overlooking?

main.py:

def get(self):
    ...
    question = randomLine("data/questions.csv")
    data = question.split(',')[0]

    template_values = {
        'data': data,
        }

    path = os.path.join(os.path.dirname(__file__), 'index.html')
    self.response.out.write(template.render(path, template_values))

index.html:

...
<div id="question">
    <p>{{ data }}</p>
</div>
...
A: 

Never mind, I solved it. I had renamed main.py, but I didn't update it in app.yaml so even though I had cleared my cache and the datastore, it was still somehow loading what was left. Doh!

Sean