'Django admin: section in app without creating a model
I need a custom section of application on admin site. It must not consider any model (proxy, unmanaged, etc), without template overriding, just a "phantom" application in programmatic way.
I expect it looking like a bunch of URLs, registered in admin and located in separated section on index page.
Hours of search and other answers without result. I tried this way in existing application, but links didn't appear.
I did
class MyModel(models.Model):
class Meta:
managed = False
registered as ModelAdmin, and it's work, and for my luck URL fully matches with my view, so I don't need make real migrations, but I find this approach too rough. I really hope, there is more elegant way, but, perhaps, I must know Django deeply.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|