Python 更新至1.8.7后删除Django中选定记录的问题
将Django更新到1.8.7后,我无法使用选择从后端删除记录 我有以下例外Python 更新至1.8.7后删除Django中选定记录的问题,python,django,python-2.7,Python,Django,Python 2.7,将Django更新到1.8.7后,我无法使用选择从后端删除记录 我有以下例外 NoReverseMatch at /admin/static_assets/staticassetdefinition/ Reverse for 'app_list' with arguments '()' and keyword arguments '{u'app_label': ''}' not found. 1 pattern(s) tried: [u'admin/(?P<app_label>pro
NoReverseMatch at /admin/static_assets/staticassetdefinition/
Reverse for 'app_list' with arguments '()' and keyword arguments '{u'app_label': ''}' not found. 1 pattern(s) tried: [u'admin/(?P<app_label>projects|accounts|static_assets|imagelibrary|pages|sites|messaging|omss_auth|system|auth|tastypie)/$']
Request Method: POST
Request URL: http://192.168.59.100/admin/static_assets/staticassetdefinition/
Django Version: 1.8.7
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'app_list' with arguments '()' and keyword arguments '{u'app_label': ''}' not found. 1 pattern(s) tried: [u'admin/(?P<app_label>projects|accounts|static_assets|imagelibrary|pages|sites|messaging|omss_auth|system|auth|tastypie)/$']
Exception Location: /usr/lib/python2.7/site-packages/django/core/urlresolvers.py in _reverse_with_prefix, line 495
Python Executable: /usr/bin/python
Python Version: 2.7.5
更新:
当我试图从后端访问任何记录的历史视图时,也会出现相同的错误
有什么想法吗?原来主应用程序中的delete\u selected\u confirmation.html模板被覆盖了。我刚刚忽略了这一点。您的错误与从数据库中删除无关,您应该发布相关的代码。您可以告诉我您需要哪些代码吗?它会影响我在后端拥有的每一个模型,无差异我的应用程序以及Django的站点和身份验证,因此我认为它一定与“app_label”有关。您在那里显示的错误将
app_label
作为空字符串,因此,无论您在哪里设置,它都将是startyes的位置,但问题是,delete_selected是在django中定义的,我可以在这里看到它,所以我没有在my admin.py中设置它。您使用的是django.contrib.admin还是其他?您正在使用自定义视图吗?
class StaticAssetDefinitionAdmin(admin.ModelAdmin):
inlines = [StaticAssetExecutionInline, StaticAssetCustomFieldDefinitionInline]
list_display = ['name', 'id', 'section', 'type', 'available', 'get_usage_rights', 'upload_execution']
actions = ['update_previews', 'regenerate_custom_definition_fields', 'check_depends', 'regenerate_default_pdf', 'test_all_executions']
list_editable = ('available',)
list_filter = ('available', SectionListFilter, StaticAssetTypeListFilter, UsageRightsFilter)
search_fields = ('name',)