Колба: Как подавать статический HTML?Html

Программисты Html
Ответить
Anonymous
 Колба: Как подавать статический HTML?

Сообщение Anonymous »

Я пытаюсь обслуживать статический HTML -файл, но возвращает ошибку 500
(копия Editor.html находится на каталоге .py и шаблонов)
Это все, что я пробовал: < /p>

from flask import Flask
app = Flask(__name__, static_url_path='/templates')
@app.route('/')
def hello_world():
#return 'Hello World1!' #this works correctly!
#return render_template('editor.html')
#return render_template('/editor.html')
#return render_template(url_for('templates', filename='editor.html'))
#return app.send_static_file('editor.html') #404 error (Not Found)
return send_from_directory('templates', 'editor.html')
< /code>

Это ответ: < /p>

Title: 500 Internal Server Srror

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.


Подробнее здесь: https://stackoverflow.com/questions/245 ... tatic-html
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Html»