{I访问工厂}我在获取图纸时出错} 当我尝试在浏览器中打开端点时,这里给出了应用程序的完整堆栈跟踪
File "/home/maverick/.local/lib/python3.5/site-packages/flask_admin/base.py", line 308, in render
return render_template(template, **kwargs)
File "/home/maverick/.local/lib/python3.5/site-packages/flask/templating.py", line 135, in render_template
context, ctx.app)
File "/home/maverick/.local/lib/python3.5/site-packages/flask/templating.py", line 117, in _render
rv = template.render(context)
File "/home/maverick/.local/lib/python3.5/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/home/maverick/.local/lib/python3.5/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/maverick/.local/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "/home/maverick/.local/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/model/list.html", line 6, in top-level template code
{% import 'admin/model/row_actions.html' as row_actions with context %}
File "/home/maverick/.local/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/master.html", line 1, in top-level template code
{% extends admin_base_template %}
File "/home/maverick/.local/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/base.html", line 14, in top-level template code
{% block head_css %}
File "/home/maverick/.local/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/base.html", line 15, in block "head_css"
<link href="{{ admin_static.url(filename='bootstrap/bootstrap3/swatch/{swatch}/bootstrap.min.css'.format(swatch=config.get('FLASK_ADMIN_SWATCH', 'default')), v='3.3.5') }}" rel="stylesheet">
File "/home/maverick/.local/lib/python3.5/site-packages/jinja2/runtime.py", line 579, in _invoke
rv = self._func(*arguments)
File "/home/maverick/.local/lib/python3.5/site-packages/flask_admin/templates/bootstrap3/admin/static.html", line 2, in template
{{ get_url('admin.static', *varargs, **kwargs) }}
File "/home/maverick/.local/lib/python3.5/site-packages/flask_admin/base.py", line 390, in get_url
return url_for(endpoint, **kwargs)
File "/home/maverick/.local/lib/python3.5/site-packages/flask/helpers.py", line 356, in url_for
return appctx.app.handle_url_build_error(error, endpoint, values)
File "/home/maverick/.local/lib/python3.5/site-packages/flask/app.py", line 2061, in handle_url_build_error
reraise(exc_type, exc_value, tb)
File "/home/maverick/.local/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/maverick/.local/lib/python3.5/site-packages/flask/helpers.py", line 345, in url_for
force_external=external)
File "/home/maverick/.local/lib/python3.5/site-packages/werkzeug/routing.py", line 2181, in build
raise BuildError(endpoint, values, method, self)
werkzeug.routing.BuildError: Could not build url for endpoint 'admin.static' with values ['filename', 'v']. Did you mean 'static' instead?
应用程序/初始化
^{pr2}$应用程序/管理员/核心.py公司名称:
class MicroModelView(ModelView):
page_size = 5
问题是什么,如何解决?在
错误是由您将
index_view
设置为ModelView
子类引起的。别那样做。在通常,} class 的实例,正是这个类注册了一个
index_view
被设置为^{admin.static
视图来处理管理UI中使用的静态文件(模板中使用的Javascript和CSS文件)。在但是
ModelView
子类没有提供这些功能。您需要用admin.add_view()
调用注册这些调用:如果要更改默认的
^{pr2}$/admin/
页面行为,则需要将AdminIndexView
类的子类化并重写其index
方法;可以重定向到users
视图,例如:相关问题 更多 >
编程相关推荐