config/database.pyfile. In this file we will be able to put all our connection information.
config/database.pyfile we can put a
DATABASESvariable with a dictionary of connection details. Each key will be the name of our connection. The connection name can be whatever you like and does not need to relate to a database name. Common connection names could be something like
staging. Feel free to name these connections whatever you like.
ConnectionResolverclass and and register the connection details. Normal convention is to set this to a variable called
config/database.pyfile through the
config/database.pyfile you can put on the bottom here. The StreamHandler will output the queries to the terminal.
DByou can import it like: