-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a configuration (admin) page for various variables #50
Comments
I think this is better implemented as a configuration page, which will only be available to admins and will list all parameters and allows their modification just by editing the fields. This “admin” page can actually be the same one with what is described in #32 |
I will add the things needed to be configurable through this interface to the issue description as a checklist. |
So besides creating a config page to tweak all those parameters, we still have to solve the problem of hardcoded configuration variables and secrets. The way I see it, the options are either to use env variables, or an external config file. Which way do you prefer to follow? |
My personal preference is a yaml file. It is easy to read and an example can be made in the repository to make it easier to configure. Some people also use config in python directly but that might not be appropriate here. |
@tcezard I can confirm we can have config variables that can be edited via the Django Admin and the changes are persistent. Here is the package to do this https://pypi.org/project/django-admin-conf-vars/, I have tested it and it works great (we are going to have to use a regular python file instead of a yaml file though. |
Update: There is actually a problem with this approach. We can't use this package in the settings.py file because the settings are loaded before the app has been initialized. Now, the good thing is that the only settings that we would want to read from an external file in the settings.py file are the SECRET_KEY setting and the database credentials. So I think we should separate the credentials and secret_key part of the settings in another file, and use the 'admin_config_vars` package for the variables that alter the app's functionality (basically every variable that has been defined for this issue). After all, the credentials shouldn't be editable by anybody in the first place. This would also allow us to commit the app's configuration file to this repo. |
I've read the discussions above and agree with the approach: having some low-level settings hardcoded in settings.py is fine, and all the rest we'll configure with |
There are parameters which we would like to be able to tweak, such as BASE_URLs for external datasources. Creating a config file to read from would provide a easy solution to that.
The text was updated successfully, but these errors were encountered: