How about having a SingletonModel in Django?

前端 未结 5 1839
一个人的身影
一个人的身影 2020-12-16 13:29

I\'m making a very simple website in Django. On one of the pages there is a vertical ticker box. I need to give the client a way to edit the contents of the ticker box as an

5条回答
  •  一向
    一向 (楼主)
    2020-12-16 14:06

    A model with only one instance, a singleton, is sometime useful for things like global settings that you want to edit from the admin instead of having them in Django settings.py.

    There are several third party applications that helps implementing singleton models and improve the admin interface for instance, django-solo, django-singleton-admin, django-singletons.

提交回复
热议问题