dnova02 / microblog

0 stars 0 forks source link

config.py with default values #2

Open vangourd opened 1 year ago

vangourd commented 1 year ago

You should include a config.py in your project with default values and a config switch to warn users not to use the default secrets OR better to use something like a pyyaml to parse a separate config.yaml for your configuration options.

vangourd commented 1 year ago

Should also maybe consider a startup configuration validator that tells you if you have the required configuration values in place if a default won't work.

For example I'm getting an error message instead of a user friendly message.

    if app.config['MAIL_SERVER']:
       ~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'MAIL_SERVER'

Something like

MAIL_SERVER not configured. Please add your values to included config.py file
e.g. ("smtp://mail.myserver.org")