Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何防止Jinja2发动机在不同的区段出现超负荷?_Html_Flask_Bootstrap 4_Jinja2 - Fatal编程技术网

Html 如何防止Jinja2发动机在不同的区段出现超负荷?

Html 如何防止Jinja2发动机在不同的区段出现超负荷?,html,flask,bootstrap-4,jinja2,Html,Flask,Bootstrap 4,Jinja2,我对Flask非常陌生,我已经阅读了相关问题,但我仍然不知道如何解决这个问题,因此非常感谢您的帮助。请不要重复这个问题 我有以下文件: index.html {% extends "bootstrap/base.html" %} {% block styles %} <!-- Bootstrap core CSS --> <link href="/static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"&

我对Flask非常陌生,我已经阅读了相关问题,但我仍然不知道如何解决这个问题,因此非常感谢您的帮助。请不要重复这个问题

我有以下文件:

index.html

{% extends "bootstrap/base.html" %}

{% block styles %}

<!-- Bootstrap core CSS -->
<link href="/static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom fonts for this template -->
<link href="/static/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">


<!-- Custom styles for this template -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/static/css/agency.css">
<link rel="stylesheet" type="text/css" href="/static/css/agency.min.css">

{% endblock %}

{% block navbar %}

<body id="page-top">

  <!-- Navigation -->
  <nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav">
    <div class="container">
      <a class="navbar-brand js-scroll-trigger" href="#page-top">RFJI Protein Database</a>
      <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
        Menu
        <i class="fas fa-bars"></i>
      </button>
      <div class="collapse navbar-collapse" id="navbarResponsive">
        <ul class="navbar-nav text-uppercase ml-auto">
          <li class="nav-item">
            <a class="nav-link js-scroll-trigger" href="{{ url_for('upload')}}">Upload File</a>
            <li class="nav-item">
              <a class="nav-link js-scroll-trigger" href="#">Protein Database</a>
          </li>
          </li>
          </li>
          </li>



          <div class="wrap">
            <div class="search">
              <div class="col-lg-11 text-center">
              <input type="text" class="searchTerm" placeholder="What are you looking for?">
              <button type="submit" class="searchButton">
                <i class="fa fa-search"></i>
              </button>
            </div>
          </div>

        </ul>


{% endblock %}

{% block content %}


              <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>

    </style>
    </head>
    <body>
          </div>
        </div>
      </nav>

    <header class="masthead">
      <div class="container">
        <div class="intro-text">
          <div class="intro-lead-in">Welcome to the RFJI Protein Database!</div>
          <div class="intro-heading text-uppercase">It's Nice To Meet You</div>

    <style>
    font-family: Arial;
    </style>

    {% endblock %}

    {% block body %}
    <!-- Services -->
    <section id="services">
      <div class="container">
        <div class="row">
          <div class="col-lg-12 text-center">
            <h2 class="section-heading text-uppercase">Features</h2>
            <h3 class="section-subheading text-muted">Lorem ipsum dolor sit amet consectetur.</h3>
          </div>
        </div>
        <div class="row text-center">
          <div class="col-md-4">
          <img src="/static/img/kinase.png" alt="Girl in a onci" style="width:80px;height:90px;">

            </span>
            <h4 class="service-heading">Search Kinases</h4>
            <p class="text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima maxime quam architecto quo inventore harum ex magni, dicta impedit.</p>
          </div>
          <div class="col-md-4">
          <img src="/static/img/inhibitor.png" alt="Girl in a onci" style="width:80px;height:90px;">
            </span>
            <h4 class="service-heading">Search Kinase Inhibitors</h4>
            <p class="text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima maxime quam architecto quo inventore harum ex magni, dicta impedit.</p>
          </div>
          <div class="col-md-4">

          <img src="/static/img/upload.png" alt="Girl in a onci" style="width:80px;height:90px;">
            </span>
            <h4 class="service-heading">Import your own dataset</h4>
            <p class="text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima maxime quam architecto quo inventore harum ex magni, dicta impedit.</p>
          </div>
        </div>
      </div>
    </section>

    {% endblock %}
{%extends“bootstrap/base.html”%}
{%block styles%}
{%endblock%}
{%block navbar%}
菜单
{%endblock%} {%block content%} 欢迎来到RFJI蛋白质数据库! 很高兴认识你 字体系列:Arial; {%endblock%} {%block body%} 特征 洛雷姆·伊普苏姆·多洛尔·阿梅特·康塞特图。 搜索激酶

Lorem ipsum door sit amet,concetetur adipising elit。最小值最大值建筑设计师“发明者”的名言

搜索激酶抑制剂

Lorem ipsum door sit amet,concetetur adipising elit。最小值最大值建筑设计师“发明者”的名言

导入您自己的数据集

Lorem ipsum door sit amet,concetetur adipising elit。最小值最大值建筑设计师“发明者”的名言

{%endblock%}
问题是Jinja2引擎只显示服务部分,而忽略了其他所有内容。请问我该怎么修?。我已经添加了一个关于我希望网站看起来如何的图片

非常感谢,


Moshi

乍一看,整个模板乱七八糟

    <>这应该完全删除,因为它不属于模板的中间:

字体系列:Arial;
  • 有多个
    标记。在正确的语法中,应该只有1个
    标记,它可能是
    base.html
    模板的一部分。在这个文件的末尾,相应的
    标签也应该出现

  • 某些
    标记未正确关闭

您确实需要返回并重新排列这个tempate,以便每个Jinja2
{%block something%}{%endblock%}
节包含一组完整的标记(例如,在endblock语句之前正确关闭的完整引导div容器块)


模板继承在Jinja2文档中。我假设您已经从其他地方剪切并粘贴了此模板的部分,只要您确保源引导模板的重要组件没有在错误的位置拆分,这不是问题。

请使用
bootstrap/base.html
的内容更新此问题。您好,我如何将其固定到适当的块中,因为我对此非常陌生,你能给我一些例子吗?但是我如何创建一个像图中那样的新部分?
    <style>
    font-family: Arial;
    </style>