简体   繁体   中英

What is the best approach to implement configuration app with Django?

I need to program kind of configuration registry for Django-based application.

Requirements:

  1. Most likely param_name : param_value structure
  2. Editable via admin interface
  3. Has to work with syncdb. How to deal with a situation in which other apps depend on configuration model and the model itself has not been initialized yet in DB? Let's say I would like to have configurable model fields properties, ie the default value setting?

Any ideas or suggestions would be appreciated.

I have found djblets.siteconfig very useful. Works great with the Admin app, and very easy to use. Highly recommended.

有一段时间(一年前),我使用dbsettings来通过管理界面访问某种业务配置,但是我不能说它今天如何适合。

I think you'll have trouble if you make other apps depend (at interpretation/app-loading time) on values set in your config app. Can you use some kind of placeholder value in Python code at interpretation time, and then pull in the real config data on the post_syncdb signal?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM