- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试制作 Django-plans应用程序工作。一切似乎都正常,除了 /admin/plans/plan/
(/admin/plans/order/
, /admin/plans/userplan/
等工作正常)。
当我在 Django-admin 中单击计划时,它会返回:
TemplateDoesNotExist at /admin/plans/plan/
我不明白为什么它不存在。我查看了 django-plans
admin.py 文件,似乎 Plan
没有指定任何特殊模板。
你知道问题出在哪里吗?
追溯
Environment: Request Method: GET Request URL: http://127.0.0.1:8000/admin/plans/plan/
Django Version: 1.10.5 Python Version: 2.7.10 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'authapp', 'presentationapp', 'allauth', 'allauth.account', 'allauth.socialaccount', 'djmoney_rates', 'djmoney', 'api', 'productapp', 'django_extensions', 'mainapp', 'django_tables2', 'engineapp', 'dashboardapp', 'ticketapp', 'celery', 'dbbackup', 'bootstrap3', 'django_filters', 'widget_tweaks', 'cacheapp', 'adminapp', 'djcelery', 'import_export', 'plans', 'request', 'django.contrib.humanize'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'authapp.middleware.BasicAuthMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'request.middleware.RequestMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']
Template loader postmortem Django tried loading these templates, in this order:
Using engine django:
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\contrib\admin\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\contrib\auth\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\Desktop\Projekty\FS Dropbox\Dropbox\priceist\authapp\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\Desktop\Projekty\FS Dropbox\Dropbox\priceist\presentationapp\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\allauth\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\Desktop\Projekty\FS Dropbox\Dropbox\priceist\productapp\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django_extensions\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\Desktop\Projekty\FS Dropbox\Dropbox\priceist\mainapp\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django_tables2\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\Desktop\Projekty\FS Dropbox\Dropbox\priceist\engineapp\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\Desktop\Projekty\FS Dropbox\Dropbox\priceist\dashboardapp\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\bootstrap3\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\Desktop\Projekty\FS Dropbox\Dropbox\priceist\adminapp\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\djcelery\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\import_export\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\plans\templates\ordered_model\admin\order_controls.html (Source does not exist)
* django.template.loaders.app_directories.Loader: C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\request\templates\ordered_model\admin\order_controls.html (Source does not exist)
Template error: In template C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\contrib\admin\templates\admin\change_list.html, error at line 82 ordered_model/admin/order_controls.html 72 : {% endif %} 73 : {% endblock %} 74 : 75 : <form id="changelist-form" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %} 76 : {% if cl.formset %} 77 : <div>{{ cl.formset.management_form }}</div> 78 : {% endif %} 79 : 80 : {% block result_list %} 81 : {% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %} 82 : {% result_list cl %} 83 : {% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %} 84 : {% endblock %} 85 : {% block pagination %}{% pagination cl %}{% endblock %} 86 : </form> 87 : </div> 88 : </div> 89 : {% endblock %} 90 :
Traceback:
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\core\handlers\exception.py" in inner
39. response = get_response(request)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\core\handlers\base.py" in _get_response
217. response = self.process_exception_by_middleware(e, request)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\core\handlers\base.py" in _get_response
215. response = response.render()
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\response.py" in render
109. self.content = self.rendered_content
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\response.py" in rendered_content
86. content = template.render(context, self._request)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\backends\django.py" in render
68. reraise(exc, self.backend)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\backends\django.py" in reraise
89. six.reraise(exc.__class__, new, sys.exc_info()[2])
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\backends\django.py" in render
66. return self.template.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render
208. return self._render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in _render
199. return self.nodelist.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render
994. bit = node.render_annotated(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render_annotated
961. return self.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\loader_tags.py" in render
174. return compiled_parent._render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in _render
199. return self.nodelist.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render
994. bit = node.render_annotated(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render_annotated
961. return self.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\loader_tags.py" in render
174. return compiled_parent._render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in _render
199. return self.nodelist.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render
994. bit = node.render_annotated(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render_annotated
961. return self.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\loader_tags.py" in render
70. result = block.nodelist.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render
994. bit = node.render_annotated(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render_annotated
961. return self.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\loader_tags.py" in render
70. result = block.nodelist.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render
994. bit = node.render_annotated(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\base.py" in render_annotated
961. return self.render(context)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\library.py" in render
225. _dict = self.func(*resolved_args, **resolved_kwargs)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\contrib\admin\templatetags\admin_list.py" in result_list
339. 'results': list(results(cl))}
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\contrib\admin\templatetags\admin_list.py" in results
315. yield ResultList(None, items_for_result(cl, res, None))
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\contrib\admin\templatetags\admin_list.py" in __init__
306. super(ResultList, self).__init__(*items)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\contrib\admin\templatetags\admin_list.py" in items_for_result
217. f, attr, value = lookup_field(field_name, result, cl.model_admin)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\contrib\admin\utils.py" in lookup_field
286. value = attr(obj)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\ordered_model\admin.py" in move_up_down_links
69. 'query_string': self.request_query_string
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\loader.py" in render_to_string
67. template = get_template(template_name, using=using)
File "C:\Users\Milano\PycharmProjects\DropboxWorkspaces\priceist_workspace\priceist_venv\lib\site-packages\django\template\loader.py" in get_template
25. raise TemplateDoesNotExist(template_name, chain=chain)
Exception Type: TemplateDoesNotExist at /admin/plans/plan/ Exception Value: ordered_model/admin/order_controls.html
我无法进入计划,其他页面工作正常。
最佳答案
对于遇到此错误的其他人,问题是您正在使用 django-ordered-model
包,但尚未添加 ordered_model
到 settings.py
中的 INSTALLED_APPS
。
关于python - Django-admin:TemplateDoesNotExist 位于/admin/plans/plan/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43282019/
我只是希望我所有的管理页面都在 /admin 下. 我的主页在 /admin但是当我单击侧栏中的用户时,它会将路径更改为 /users而不是 /admin/users . 我正在使用 rea
我在端口 8011 上设置了一个 Django 服务器,并在端口 80 上有一个 nginx 作为子目录服务。 静态文件,不错。 页面,很好。 但是当我访问/subdirectory/admin/时,
我正在尝试使用 Flask 和 Flask-SuperAdmin 自定义我的 Admin View ,但是,索引 View 和 subview 显然没有使用相同的 is_accessible 方法:
我正在尝试配置我的 .htaccess,以便当有人导航到路径 /wp-admin/admin.php?page=something 时,路径 /wp-admin/something显示在浏览器中,内容
有没有办法整体禁用分页?我希望我的所有记录都显示在一个长列表中,而不是分成几页。我现在正在使用 ListGuesser,我已经尝试过 List 和 ListGuesser,但我无法禁用分页。实际上 r
在本地部署时,我的 RA 项目呈现良好,但是,当我将构建目录复制到 S3 存储桶进行部署时,它呈现的一切都一团糟。有时它有效,但大多数时候它呈现如下图所示。它在带有 AOR 的两种环境中都能正常工作。
我试图在 Datagrid 中显示Field这是多对多关系(中间表)。 我有这些表: 组 - group_subject - 主题 一个小组可以有多个科目 一个主题可以连接多个群组 group_sub
在用于显示用户列表的 Django 管理屏幕中(带有标题,选择要更改的用户),有用户名/电子邮件等字段和员工状态。我想将用户的事件状态添加到该显示中。 尽管大多数 django-admin 自定义问题
无论如何要检查所有 firebase 事务是否在 firebase-admin nodejs 脚本中完成,并正确断开与 firebase 的连接并退出 nodejs 脚本? 目前,即使在所有事务完成后
我正在尝试使用 react-admin 将数据发送到我的自定义 API。我想发送文件,我可以看到有,我想将该数据作为多部分表单数据发送。我遇到过the base64 encoding help pag
我正在尝试在admin部分中实现带有子表单的表单。 form = Fighter() subform = FighterFightHistory() //All of his fights 我的问题如
我在编辑表单中获取记录的“更新”值时遇到了很大的麻烦。我总是得到初始记录值,即使我有一个链接到正确记录源的输入,它应该更新它。 有没有其他方法来获取 SimpleForm 的值? 我有一个简单的编辑表
开发一个不需要翻译的管理员。有没有办法完全关闭它们。就像现在一样,对于诸如通知之类的事情,它们会显示,但我也会收到有关缺少翻译键的控制台警告。 最佳答案 除了 Frederik 的回答之外,以下是禁用
开发一个不需要翻译的管理员。有没有办法完全关闭它们。就像现在一样,对于诸如通知之类的事情,它们会显示,但我也会收到有关缺少翻译键的控制台警告。 最佳答案 除了 Frederik 的回答之外,以下是禁用
我有这样的模型: class User(db.Model): __tablename__ = 'users' __table_args__ = {'mysql_engine' : 'I
我已经使用 Media 类自定义了我的内联模型。 我想自定义内联字段集以实现两件事: 为每一行添加一个按钮 按下“添加新行”时从 javascript 代码运行 我试过覆盖 tabular.html
我的所有管理员/任何 url 正在呈现管理文件,但是当我尝试只点击管理员时,它显示 404 不在这条路线上。我可以为 url/admin 创建单独的路由,但这是他们的任何其他选项。这样我只能通过单一路
虽然我使用了许多图表,如 HighCharts、Charts.js、C3、D3,但是否有人尝试过或是否有一些关于如何将任何图表框架包含在 React-admin 中的文档?我看了一些,但看起来我们必须
react-admin 文档将资源的默认路由解释为: /posts/:id 映射到 PostEdit /posts/:id/show 映射到 PostShow 我希望我的应用程序默认为查看,并且仅当用
我正在使用 react-admin 前端框架,想知道是否有办法从路由中删除“#”。我正在使用 customRoutes 属性为我们的系统提供路由集合。 ``` 最佳答案 您可以创建自己的历
我是一名优秀的程序员,十分优秀!