问题描述
可以通过硬编码 URL 来伪造它:
BATON = {
"SITE_HEADER": "My App","MENU": (
{
"type": "app","name": "core","label": "Management","icon": "fa fa-cog","models": (
{"name": "client","label": "Clients"},{"name": "invoice","label": "Invoices"},),},{
"type": "free","name": "docs","label": "Documentation","icon": "fa fa-info","url": "https://www.myurl.com/docs/",
尝试使用“视图”或“视图”来完成模型:
{
"type": "app","view": {"docs_general"},
和
{
"type": "app","views": ({"docs_general"}),
似乎没有记录。
解决方法
视图映射在 urls.py
内,因此只需使用软链接:
BATON = {
"SITE_HEADER": "My App","MENU": (
{
"type": "app","name": "core","label": "Management","icon": "fa fa-cog","models": (
{"name": "client","label": "Clients"},{"name": "invoice","label": "Invoices"},),},{
"type": "free","name": "docs","label": "Documentation","icon": "fa fa-info","url": "/docs/",