gpt4 book ai didi

django - 找不到 'filer_folder_changelist' 的反向

转载 作者:行者123 更新时间:2023-12-05 05:13:49 25 4
gpt4 key购买 nike

我正在使用 django 和 django-cms 将站点部署到 divio 服务器。我从事研发工作,但没有找到太多这方面的信息。

面临错误:找不到“filer_folder_changelist”的反向。 “filer_folder_changelist”不是有效的 View 函数或模式名称。

Exception Type: NoReverseMatch Exception Value: Reverse for 'filer_folder_changelist' not found. 'filer_folder_changelist' is not a valid view function or pattern name. Exception Location: /virtualenv/lib/python3.5/site-packages/django/urls/resolvers.py in _reverse_with_prefix, line 497 Python Executable: /virtualenv/bin/uwsgi

{% cms_toolbar %}

**urls.py:**

] + aldryn_addons.urls.patterns() + i18n_patterns(
# test urls
url(r'^admin-cms/', include(admin.site.urls)), # NOQA
url(r'^django-cms/', include('cms.urls')),
url(r'^django-cms1/',include('aldryn_django_cms.urls')),
url(r'^test4/$',views.test4,),
# ends here ~ test urls
# add your own i18n patterns here
*aldryn_addons.urls.i18n_patterns() # MUST be the last entry!
)

cms_toolbar.py

def populate(self):
media_library = _('Media library')

admin_menu = self.toolbar.get_or_create_menu(ADMIN_MENU_IDENTIFIER)
admin_menu.add_sideframe_item(
media_library,
url=reverse('admin:filer_folder_changelist'),
position=self.get_insert_position(admin_menu, media_library)
)

最佳答案

做了一些研究,发现了这个:

  1. 需要安装django-admin-shortcuts
  2. 将快捷方式添加到您的 settings.py:

      ADMIN_SHORTCUTS = [
    {
    'shortcuts': [
    {
    'url_name': 'admin:filer_folder_changelist',
    'title': _('Files'),
    },

    ]
    },
    ]

您可以在 here 中查看类似的实现.希望对您有所帮助!!

关于django - 找不到 'filer_folder_changelist' 的反向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53166485/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com