Po raz pierwszy uczę się Flasku i staram się budować rzeczy po tutorialu. Otrzymuję tę wiadomość w przeglądarce po wprowadzeniu tego adresu URL:Wewnętrzny błąd serwera Flask
http://127.0.0.1:5000/index
127.0.0.1 - - [16/Jun/2014 19:37:41] "GET /index HTTP/1.1" 500 -
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Nie jestem pewien, dlaczego otrzymuję ten błąd. Czy ktoś może mi pomóc i powiedzieć dlaczego? Jestem nowy w kolbie i tworzenie stron internetowych
Kod:
from flask import Flask, request, make_response, redirect, render_template
from flask.ext.script import Manager
from flask.ext.bootstrap import Bootstrap
app = Flask(__name__)
manager = Manager(app)
bootstrap = Bootstrap(app)
@app.route('/index')
def index():
return render_template('index.html')
@app.route('/user/<name>')
def user(name):
return render_template('user.html', name = name)
if __name__ == '__main__':
#app.run(debug = True)
manager.run()
index.html:
{% extends "base.html" %}
{% block title %} Index {% block title %}
{% block head %}
<!-- Uses super() to retain the original contents-->
{{ super() }}
<style type="text/css">
</style>
{% endblock %}
{% block body %}
<h1>Hello, World!</h1>
{% endblock %}
To jest mój struktury projektu:
/Flask_0_11
/templates
base.html
index.html
user.html
hello.py