首页 > 解决方案 > 白页为什么单击新创建的按钮

问题描述

我创建了一个按钮,它应该在新页面上进行重定向。但是当我点击它时,我得到一个没有任何信息的白页。

这是urls.py文件的。

url(r'^layer_quarantine/', TemplateView.as_view(template_name='layer_quarantine.html'), name='layer_quarantine'),

这是名为的文件_layer_quarantine.html

{% extends "layers/layer_base.html" %}
{% load i18n %}
{% load staticfiles %}
{% load url from future %}
{% load base_tags %}

{% block title %} {% trans "Explore Layers" %} - {{ block.super }} {% endblock %}

{% block body_class %}layers explore{% endblock %}

{% block body %}
<div class="page-header">
    {% user_can_add_resource_base as add_tag %}
    {% if add_tag %}
  <a href="{% url "layer_upload" %}" class="btn btn-primary pull-right">{% trans "Upload Layers" %}</a>
  <a style="margin-right:30px" href="{% url "layer_browse" %}" class="btn btn-success pull-right">
  {% if LANGUAGE_CODE == "fr" %} Toutes les couches {% else %} All layers {% endif %}</a>
    {% endif %} 
  <h2 class="page-title">
  {% if LANGUAGE_CODE == "fr" %} Couches en attente de validation
  {% else %} Layers awaiting validation {% endif %}
  </h2>
</div>


  {% with include_type_filter='true' %}
  {% with facet_type='layers' %}
  {% with header='Type' %}
  {% with filter='type__in' %}
  {% include "search/_search_content.html" %}
  {% endwith %}
  {% endwith %}
  {% endwith %}
  {% endwith %}
  {% with is_layer='true' %}
  {% include "_bulk_permissions_form.html" %}
  {% endwith %}
{% endblock %}

{% block extra_script %}
  {% if GEONODE_SECURITY_ENABLED %}
    {% include "_permissions_form_js.html" %}
  {% endif %}

  <script type="text/javascript">
      {% if HAYSTACK_SEARCH %}
          SEARCH_URL = '{% url 'api_get_search' api_name='api' resource_name='base' %}?type__in=layer'
      {% else %}
          SEARCH_URL = '{% url 'api_dispatch_list' api_name='api' resource_name='layer_quarantine' %}';
      {% endif %}
    FILTER_TYPE = 'layer';
  </script>
  {% with include_spatial='true' %}
  {% include 'search/search_scripts.html' %}
  {% endwith %}
{% endblock extra_script %}

我也有layer_quarantine.html文件

{% extends "geonode_base.html" %}

{% load il8n %}

{% %block title %} {% trans "Documents in standby" %} {% endblock %}

{% block body_outer %}
    {% include 'documents/_document_quarantine.html' %}
{% endblock %}

这就是我制作按钮的方式

<a style="margin-right:30px" href="{% url "layer_quarantine" %}" class="btn btn-warning pull-right">

如果有人可以帮助我解决这个问题,那就太好了,因为我已经有一段时间了,我不知道如何解决这个问题。我不习惯做网络开发,所以请客气。

标签: pythonhtmldjangopython-3.x

解决方案


推荐阅读