伙计们,我知道对此有很多答案,但它对我不起作用。我试图在应用程序的初始化中指定 url,但仍然无法为我工作。我错过了什么吗?我正在尝试将背景更改为图像这是我的目录└── wine ├── __init__.py ├── __init__.pyc ├── __pycache__ │ ├── __init__.cpython-37.pyc │ ├── models.cpython-37.pyc │ └── routes.cpython-37.pyc ├── models.py ├── routes.py ├── site.db ├── static │ ├── bg.jpeg │ ├── main.css │ ├── pexels-photo-935240.jpeg │ ├── pexels-photo.jpg │ └── sf.jpg └── templates ├── index.html └── rec.html这是我为烧瓶安装的 html 文件。 {% extends "material/base.html" %}{% import "material/wtf.html" as wtf %}<head> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css') }}"> {% block title %} Welcome {% endblock %}</head>{% block content %}<div class="container"> <h1>Whats Your Taste</h1> <div class="row"> <form method="POST" action="/"> {{ wtf.quick_form(form)}} </form> </div></div>{% endblock %}我的 css 'main.css'body{ background-image: url({{ url_for ('static', filename = 'bg.jpeg') }});}
添加回答
举报
0/150
提交
取消