白页为何单击新创建的按钮

时间:2019-09-12 11:13:07

标签: python html django python-3.x

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

这是文件的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">

如果有人可以帮助我,这是很可爱的,因为我已经从事了一段时间,而且我不知道如何解决这个问题。我不习惯从事网络开发,所以请客气。

0 个答案:

没有答案