I was trying to figure out a plan of action on how to approach this project. Consequently, I was looking at how Django internally manages things. I had a doubt about the ‘Convention over Configuration’ aspect.
Following the aforementioned principle, Django, is able to locate corresponding views, static files, given that recommenced naming convention is followed. In the scope of this project, Secrets Manager, ideally, a similar flow should be in place when per-environment are .env files that are read by, let’s say, django-environ. 2 approaches could be considered here:
- Have the end-user enter the path of the .env files and have the end-user register the .env with a label that she/he can later give as an input to manage.py to specify which .env to use
- Read all .env files in the scope of the project and define a naming convention such that the app for secrets management parses the name of the file to define the label for that .env, again, this label will have to be used by the end-user
I feel approach 2 is more Django-like. In case, you would recommend this approach (2), I would like some help in understanding how Django manages to prune through the file structure and achieve ‘Convention over Configuration’.
Also, please let me know if neither of the approaches can be deemed appropriate.
Thanking you in anticipation,
Abhirav Dilip Kariya
NCSU (Master’s in Machine Learning)