мой каталог :< /p>
ICT239
|
приложение
|
_pycache
|
контроллеры
|
| - - - _pycache
| - - - Tours.py
|
модели
|
| - - - _pycache
| - - - ToursData.py
|
статический
|
| - - - CSS
| - - - img
| - - - js
|
шаблоны
|
venv
|
init.py
|
app.py
|
requirements.txt
app.py
Код: Выделить всё
`from flask import render_template
from app import app
@app.route("/")
@app.route("/about")
def about():
return render_template("about.html")`
init.py**
`из фляги импорта колбы
Код: Выделить всё
from controllers.tours import toursBP
def create_app():
app = Flask(__name__)
app.config['SE']
app.register_blueprint(toursBP)
return app
app = create_app()`
Код: Выделить всё
`from flask import Blueprint,render_template
from models.toursData import Tour
toursBP = Blueprint("toursBP",__name__)
@toursBP.route("/tours")
def tours():
tours,countries = Tour.getAllToursBy()
print(tours)
return render_template("tours.html",tours =tours,countries = countries)`
Подробнее здесь: https://stackoverflow.com/questions/790 ... lar-import