Skip to main content
1 of 4

Configurations should be stored in a configuration file(.cfg /.ini /.env) . You can use Python Decouple for simple usecase without namespaces. If you want to use namespaces check out the inbuilt ConfigParser module.

This :

if host is None:

can be

if not host: