Я пытаюсь обслуживать статический 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
Колба: Как подавать статический HTML? ⇐ Html
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как правильно сделать SSR с BUN и подавать index.html в качестве отправной точки?
Anonymous » » в форуме Javascript - 0 Ответы
- 7 Просмотры
-
Последнее сообщение Anonymous
-