引导主题未在django中加载

时间:2017-03-09 18:51:58

标签: python django twitter-bootstrap

我正在尝试为书店应用程序制作布局...我已经通过命令行安装了bootstrap,我正在尝试加载Simplex主题。

我收到此错误

TemplateSyntaxError at /store/
'bootstrap_styles' received some positional argument(s) after some keyword argument(s)

此外,当我删除该行代码并尝试执行它时,我收到错误{%endblock%}

此..

TemplateSyntaxError at /store/
Invalid block tag: 'endblock'

这是我的base.html

{% extends 'bootstrap3/bootstrap3.html' %}

{% load staticfiles %}

{% load bootstrap3 %}

{% load bootstrap_themes %}
{% bootstrap_styles theme='simplex' type ='min.css' %}

{% block bootstrap3_extra_head %}
<link href = "http://fonts.googleapis.com/css?family=Open+Sans:400,300,700" rel = "stylesheet" type="text/css"/>
<link href = "{% static 'base/css/style.css' %}" rel = "stylesheet" type="text/css"/>
{% endblock %}


        {% block bootstrap3_title %}
        {%block title %}
            Welcome to Pick A Book !!
        {%endblock %}
    {% endblock %}

    { block bootstrap3_content %}

<nav class = "navbar navbar-inverse navbar-fixed-top">
    <div class = "container">
        <div class = "navbar-header">
            <button type="button" class ="navbar-toggle" data-toggle="collapse" data-target = "#navbar">
                <span class = "icon-bar"> </span>
                 <span class = "icon-bar"> </span>
                 <span class = "icon-bar"> </span>

            </button>
            <a href="{% url 'index' %}" class = "navbar-brand"> Pick A Book</a>
        </div>
        <div id = "navbar" class ="collapse navbar-collapse">

            <ul class ="nav navbar-nav">
                <li class = "hvr=curl-top-right"><a href = "{% url 'index' %}">Home</a>  </li>
                <li class = "hvr=curl-top-right"><a href = "#about"> About</a>  </li>
                <li class = "hvr=curl-top-right"><a href = "#contact">Contact</a>  </li>

            </ul>

            <div class = "navbar-form pull-right">
                {% if request.user.is_authenticated %}

                         Welcome {% if request.user.first_name %}
                        {{ request.user.first_name }}
                        {% else %}
                            {{ request.user.username }}
                            {% endif %}!<a href = "{% url 'auth_logout' %}"> Log Out </a>
                        {%  else %}
                        Welcome,<a href = "{% url 'auth_login' %}"> Log In</a>  or <a href="{% url 'registration_register' %}" > Register</a>
                        {% endif %}
            </div>
        </div>

    </div>
    </nav>
    <div class = "container-fluid">
        <img src  = "{% static 'base/img/header_full.jpg' %}" class ="bg">
        <div class = "parallax">
                <div class ="row">
                   { % block body %}
                <div class = "col-md-8 col-md-offset-2 col-sm-12 maincontent">
                     Welcome to our Store.
                </div>
                {%endblock%}
                </div>


        </div>


    </div>
    <div class = "row text-center navbar footer">
        <div class = "col-md-12">

            <p>  2017 Pick A Book. Developed by  <a href="http://kshitijrangai.com"> Kshitij Rangari </a> </p>
        </div>

    </div>

{%endblock%}

1 个答案:

答案 0 :(得分:0)

有一些语法错误

{% block bootstrap3_title %} {%block title %} #<<<<<<<<<<<<<<< {% block title %} Welcome to Pick A Book !! {%endblock %} #<<<<<<<<<<<<<<<< {% endblock %} {% endblock %} { block bootstrap3_content %} #<<<<<<<<<<<<<<<< missing % after {