La prima volta che impariamo a Flask e sto cercando di costruire le cose seguendo un tutorial. Sto ottenendo questo messaggio nel mio browser quando ho ingresso questo URL:Errore interno del server 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.
non sono sicuro perché sto ottenendo questo errore. Qualcuno potrebbe darmi una mano e dirmi perché? Sono nuovo di pallone e lo sviluppo del web
codice:
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 %}
Questa è la mia struttura di progetto:
/Flask_0_11
/templates
base.html
index.html
user.html
hello.py