Tuesday, 15 June 2010

python - How to make some Django settings accessible by staff? -


In Django, settings are stored in a file, settings.py This file is part of the code, and goes to the repository. This is only the developers who deal with this file. Administrator, the data in the model is related to the database. This is the data that the non-development employee edits, and the site visitors are provided in templates.

The thing is that our site and many others have many settings options, which are non-developer staffs, we are talking about the single site-wide constant, which is actually someone in the database There are no places. They will be put into the database. Caching can result in many useless questions, but what can be done with one line in the settings.py file is unnecessarily complex.

I have notices, but it is old and ineligible. I have also noticed that the use of this DBSTiting app in the DJGongo E-Commerce App Satchmo includes case-specific forks. We can create something similar in our site, an app that stores some settings as a key / value pair in a database table, but it looks like a really wrong approach. Why do some put in DB, which is not for non-developers to make it more easily editable?

There is a list on the Genetic site on our site that we want to make editable, what is the best way to go about this by non-Developer Administrators?

Go to something (as you've mentioned). For that project:

Not all settings are in settings.py , because it has certain limitations:

  • Settings are project-wide, it not only requires cluttering to settings.py , but also increases the chances of naming conflicts.

  • Django They can not be changed without restarting the application.

  • The settings require a programmer to make changes. This is true, even if the settings have no effect.

If dbsettings does not work for you, then implement your own, or fork it. It does not seem that it will be very difficult.


No comments:

Post a Comment