I'm trying to render the sortable table that's provided in Google visualization API in my app on app engine, but it's not working. The app is written in python and uses the django framework.
When I copy the generated HTML/Javascript and save it as a plain html file locally, it works just fine. This leads me to believe that the problem is that is not getting included or is not able to run.
Anyone else run into this? Am I missing some configuration piece in app.yaml?
Thanks!
EDIT: Here's the HTML that is being produced:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1 DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
Test
</title>
<link href="/css/css.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='http://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['table']});
google.setOnLoadCallback(drawTable);
function drawTable() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Number');
data.addColumn('string', 'Status');
data.addColumn('string', 'Nickname');
data.addColumn('string', 'Target');
data.addColumn('string', 'Recording');
data.addRows(2);
data.setCell(0, 0, '0987654321');
data.setCell(0, 1, 'Active');
data.setCell(0, 2, 'Nothing');
data.setCell(0, 3, '1234567890');
data.setCell(0, 4, 'Enabled');
data.setCell(1, 0, '0987654321');
data.setCell(1, 1, 'Active');
data.setCell(1, 2, 'Nothing');
data.setCell(1, 3, '1234567890');
data.setCell(1, 4, 'Enabled');
var table = new google.visualization.Table(document.getElementById('table_div'));
table.draw(data, {showRowNumber: true});
}
</script>
</head>
<body>
<div id='table_div'></div>
</body>
</html>
This works fine if saved as an html file.
app.yaml:
application: testapp
version: 2
runtime: python
api_version: 1
handlers:
- url: /(.*\.(mp3|wav))
static_files: \1
upload: (.*\.(mp3|wav))
- url: /css
static_dir: css
- url: /.*
script: main.py