Я относительно новичок во Flask, и я пытаюсь заставить мой файл main.ss взаимодействовать с моим файлом base.html. Когда я вношу изменения в код CSS, это не отражается при просмотре приложения в браузере. Любая помощь будет принята с благодарностью!
Путь к файлу base.html - документы / ds / ds / templates / base.html. Путь к файлу main.css - документы / ds / ds / static / main.css
Код заголовка base.html гласит:
<!DOCTYPE html>
<html>
<head>
<title> Deplorable Snowflake </title>
<link href = "/static/main.css" rel = "stylesheet">
<link href = "https://cdnjs.cloudflare.com/ajax/libs/twitter-
bootstrap/3.3.7/css/bootstrap.min.css" rel = "stylesheet"
media = "screen">
<script src = "https://code.jquery.com/jquery-latest.js"></script>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/twitter-
bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src = "{{ url_for('static', filename='moment.min.js') }}">
</script>
<script src = "{{ url_for('static', filename='script.js') }}"></script>
<script type = "text/javascript"
src = "//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js">
</script>
<meta name = "viewport" content = "width=device-width, initial-scale=1.0">
</head>
Это то, как я на него ссылаюсь в шапке? ...






Сменить <link href = "/static/main.css" rel = "stylesheet">
к:
<link href = "{{ url_for('static', filename='main.css') }}" rel = "stylesheet">
и убедитесь, что файл main.css помещен в вашу статическую папку.