- 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/
我正在使用 javascript 并有以下类: const Product = require('../models').Product class ProductService { cons
我正在开发一个简单的应用程序,宠物用户可以在其中创建关于他们宠物的板并在板上显示图片。 我正在尝试创建一个功能,用户可以点击他们的图板,将他们重定向到他们的图板,该图板将显示他们所有的宠物图片。 当我
我有这样的事情:循环遍历 ids,并对每个 ids 向服务器(同一域)发出 ajax 请求 (async:true) 并将接收到的数据附加到 DOM 元素。这不是一项艰巨的任务,它确实有效。示例代码:
我正在尝试使用 Pillow 在我的网络应用程序中添加用户可上传的图像。我创建了一个 Django Upload 模型并将其注册到 Admin 中。当我使用管理控制台添加照片后,我收到以下错误。最初该
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
说到 UINavigationBar 时我有点困惑。我以编程方式设置它,它的作用是将我的 viewController 向下推(因此在启动应用程序后看不到 Storyboard中看到的 View 底部
我有以下查询,它可以满足我的要求,并显示从出生日期转换而来的人们的年龄。但我现在想通过说大于或小于这些年龄来缩小结果范围,但我不知道该怎么做。 SELECT u.`id` as `user_id`
我有一个 ListView (不是 recyclerView),其中每一行都有一个按钮、几个 TextView 和一个 EditText。单击特定按钮(“editTremp”)后,我希望 EditTe
我的 cellAtIndexPath 中有一个查询。正如常见的那样,此查询从单元格行索引处的数组中获取对象。我想知道每次加载 tableView 时是否只有一个查询,还是将其算作每个 indexPat
我目前正在探索 http://www.ecovivo.be/rubriek/food 上使用的模板中的错误. 问题:访问该链接时,您会注意到右侧有一个带有内容的大型 float 图像。现在一切正常。但
我在 ViewController 之间通过引用传递特定模型的数组。 如果我更改数组中特定元素的任何值,它会在所有 ViewController 中很好地反射(reflect),但是当我从该数组中删除
svg 包含更多元素,其中之一是下拉选择器。我遇到的问题是选择器只能在其顶部边缘被点击,而不能在选择器的其他任何地方被点击。 选择器称为 yp-date-range-selector。在下一张图片中,
我的元素使用 20 行 20 列的 css 网格布局(每个单元格占屏幕的 5%)。其中一个页面有一个按钮。最初该页面包含在网格第 5-8 列和网格第 6-9 行中,按钮本身没有问题,但我需要将其居中放
我想使用 CSS Trick 使图像居中.但是如果图像大小是随机的(不固定的)怎么办。令人惊讶的是,我不想保持图像响应,我想在不改变其宽度或高度(实际像素)的情况下将图像置于中心。 下面是我的代码:
我正在尝试在网址之间进行路由。产品是一个类: from django.db import models from django.urls import reverse # Create your mo
我正在通过查看 Django 教程来制作网站。我收到一个错误: NoReverseMatch at /polls/ Reverse for 'index' with no arguments not
我一直在试用 Django 教程 Django Tutorial Page 3并遇到了这个错误 "TemplateDoesNotExist at /polls/ " . 我假设问题出在我的代码指向模板
我有一个应用程序,其中大部分图像资源都存储在单独的资源包中(这样做是有正当理由的)。这个资源包与主应用程序包一起添加到项目中,当我在 Interface Builder 中设计我的 NIB 时,所有这
我使用 Xcode 6.3.2 开发了一个 iPad 应用程序。我将我的应用程序提交到 App Store 进行审核,但由于崩溃而被拒绝。以下是来自 iTunes 的崩溃报告。 Incident Id
我正在使用以下内容来显示水平滚动条: CSS: div { width: 300px; overflow-x: scroll; } div::-webkit-scrollbar {
我是一名优秀的程序员,十分优秀!