皆様いつもお世話になっております。
「1日で理解するBOTTLEの使い方」という書籍を読みながらコードを写経しているのですが、
Internal Server Error
Exception:
SyntaxError('unexpected EOF while parsing', ('/Users/myname/pythons/bottleproject/views/index.html', 16, 13, "'</html>',))\n"))
Trackback:
File "/Users/myname/pythons/bottleproject/views/index.html", line 16
'</html>',))
^
SyntaxError: unexpected EOF while parsing
実行すると上記のエラーが発生してしまいます。何が原因なのでしょうか?
ご指摘のほどよろしくお願いします。
エラーの出るコードは以下の通りです。
Python
1[index.py] 2 3#!/user/bin/env python 4# -*- coding: utf-8 -*- 5from bottle import route, run, template, static_file, url 6 7@route('/') 8def html_index(): 9 return template('index', url=url) 10 11@route('/static/<filepath:path>', name='static_file') 12def static(filepath): 13 return static_file(filepath, root='./static') 14 15run(host='localhost', port=8080, debug=True)
html
1index.html 2 3<!DOCTYPE html> 4<html lang="ja"> 5<head> 6 <meta charset="UTF-8"> 7 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <link href="{{url('static_file', filepath='../static/css/bootstrap.min.css'}}" rel="stylesheet"> 9 <title>Title</title> 10</head> 11<body> 12 <div class="container"> 13 <div class="row"> 14 <h1>Hello world!</h1> 15 </div> 16 </div> 17</body> 18</html>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/06 12:44