config

Configuration files for the app. We will put all of the config settings into and Enum class for easier reference.

  1. Configuration Files
    • app_config.py
    • document_style.py
    • flask_app.py

app_config.py

Import the standard Enum class

VERSION is just for reference, value is not that key.

DATABASE is the relative location from the base directory, it should be a subdirectory inside of the app folders.

document_style.py

The following are the document options when creating the Microsoft Word document.

Most of the options are self explanatory. And for most part, the default values in this file should work.

The only ones that might need adjustment are

OUTPUT_FILE_USE_PLACEHOLDER_VALUE: True

OUTPUT_FILE_PLACEHOLDER_TO_USE: ‘Valid_Placeholder_Name’

If generating the Microsoft Word file to download you want to automatically put the value from one of the defined placeholders in the template file, you can set the OUTPUT_FILE_USE_PLACEHOLDER_VALUE can set the value to True, and in the OUTPUT_FILE_PLACEHOLDER_TO_USE set the value to a placeholder in the document.

When working with DATE_FORMAT and FILENAME_DATE_FORMAT configuration, you can reference, the appropriate codes here. Python String Format Codes

flask_app.py

Here are the configuration settings that are passed to the flask application. The key one is to define how we will store the SESSION variable information. Using sqlalchemy and table name of sessions, seems to be the most common way of doing it. Since the app is running locally, I wouldn’t be overly concerned about the settings here.

I set up debug, test, prod port numbers, most likely you would only run the app on the PROD port number.