我突然在生产Django webapp中遇到NoReverseMatch错误。此代码在几个月内没有变化。可能导致这种情况的原因是什么?
网址
urlpatterns = patterns('reports_views.views',
# report patterns plain urls
url(r'^patterns/$', 'patterns'),
url(r'^patterns/create/(?P<alias>[a-z_]+)$', 'create_report_pattern'),
url(r'^patterns/edit/(?P<pattern_id>[0-9]+|)$', 'edit_report_pattern'),
TEMPLATE acc_base.html
<li id="bt_patterns">
<a href="{% url 'reports_views.views.patterns' %}">
<span class="icon icon-sitemap"></span>{% trans "Templates" %}
</a>
</li>
TEMPLATE reports_patterns.html
{% extends 'acc_base.html' %}
{% load staticfiles %}
{% load acctags %}
{% load i18n %}
{% block breadcrumb %}
<div class="left">
<ul class="breadcrumb">
<li><a href="/">{% trans "Home" %}</a></li>
<li><a href="{% url 'reports_views.views.reports' %}">{% trans "Reports" %}</a></li>
<li><a href="{% url 'reports_views.views.patterns' %}">{% trans "Report Templates" %}</a></li>
</ul>
</div>
功能
@login_required
@access_focus
def patterns(request):
data = dict()
data['patterns'] = report_registry.get_available_reports()
data['data'] = request.db_session.query(ReportPattern).order_by(ReportPattern.name)
return render_to_response('reports_patterns.html', data, context_instance=RequestContext(request))
感谢您的帮助!