mysociety / pombola

GNU Affero General Public License v3.0
65 stars 41 forks source link

Move most settings into database so they can be set in admin #722

Closed evdb closed 8 years ago

evdb commented 11 years ago

This would allow admins of the site to change them making management of the site easier. Missing settings would not be caught during deploy, so sensible defaults would need to be provided.

Looking at all the settings in general.yml-example the following three types exist:

Need to be set from config on server:

These are values that are needed to connect to database, expected (or used to set other keys that are expected) by django to be available via django.conf.settings or are used to configure the app at start up (so would need a reboot to take effect).

POMBOLA_DB_HOST
POMBOLA_DB_PORT
POMBOLA_DB_USER
POMBOLA_DB_NAME
POMBOLA_DB_PASS

STAGING
TIME_ZONE

DJANGO_SECRET_KEY

MANAGERS_NAME
MANAGERS_EMAIL

ERRORS_NAME
ERRORS_EMAIL

FROM_EMAIL

SELENIUM_PATH

COUNTRY_APP
OPTIONAL_APPS

Could be stored in database:

These are used rarely, are used in templates, and can all have sensible defaults.

GOOGLE_ANALYTICS_ACCOUNT

IEBC_API_ID
IEBC_API_SECRET

KENYA_PARSER_PDF_TO_HTML_HOST

DISQUS_SHORTNAME
DISQUS_USE_IDENTIFIERS

POLLDADDY_WIDGET_ID

TWITTER_USERNAME

TWITTER_WIDGET_ID

BLOG_RSS_FEED

MAP_BOUNDING_BOX_NORTH
MAP_BOUNDING_BOX_EAST
MAP_BOUNDING_BOX_SOUTH
MAP_BOUNDING_BOX_WEST

There may well be a settings app that will do most of this for us.

dracos commented 11 years ago

Which of these actually change really, post launch? It is quite a bit of work - and threw up lots of complications when attempted in FixMyStreet - and I'm not sure of the benefit.

evdb commented 11 years ago

After launch they do change rarely, but it has been requested in the past that some things (like the polls) be switched off for a while.

When developing new features it would be nice not to have to go into the config files to add a config value to the general.yml to keep the deploy process happy, especially when there are several sites on different branches so not all can have the value present.

I believe @JenMysoc and @davewhiteland have other circumstances when it would be useful, from talking to potential reusers.

What were the biggest complications in FMS?

mhl commented 10 years ago

Comment from estimation session in Wales: "see #613 and #829"

paullenz commented 8 years ago

Our partner admin users only currently work on site data - they don't need this level of control - given this and the lack of likely future sites (and those that may come are most likely to be technically managed by mySociety) I am closing