为什么要单击新建按钮

2024-10-02 16:31:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经创建了一个按钮,可以在新页面上进行重定向。 但当我点击它时,我看到一个没有任何信息的白色页面。你知道吗

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

如果有人能在这件事上帮我,那就太好了,因为我已经做了一段时间了,我不知道怎么解决这个问题。我不习惯做网络开发,所以请善待我。你知道吗


Tags: namelayerapiurlbaseincludehtmlwith