Architecture

Automail is a monolithic software based on the Python web framework Django.
All development is made in accordance with the Django guidelines.
As such, it follows the Model View Template design pattern, which consists of the following three entities:
  1. 1.
    Model
  2. 2.
    View
  3. 3.
    Template
The user interacts with Automail using a URL that is used to redirect the requests to the appropriate View, which will interact with the Model to retrieve the necessary data from the database. The View will then render an appropriate Template along with the retrieved data to the user.

Model

A Model is an object that defines the structure of the data in Automail and is an abstraction of database tables.
It is responsible for maintaining the entire application’s data for which it provides various mechanisms to add, update, read, and delete the data in the database.
The interaction with the database is always done through the Object Relational Mapper (never through direct SQL code).
The recommended database for Automail is MySQL, which requires the installation of the corresponding drivers (pip install PyMySQL mysqlclient) and MySQL Workbench with the MySQL Community Server for local development and testing.
Other possible relational databases are PostgreSQL (pip install psycopg2, and install pgAdmin and the server), MariaDB, and MSSQL (MSQL support will be dropped in Automail v10).
The model is managed by models.py.
You can generate an Entity-Relationship diagram of your model through forward engineering by running python automail.py graph_models custom_web -a -o "[absolute path]\Data Model.png".
This requires the installation of pyDotPlus (pip install pydotplus).

View

A View is a handler function that accepts HTTP requests, processes them, and returns the HTTP response.
It retrieves the necessary data to fulfill the request using Models and renders them on the user interface using Templates.
It can also create an HTML page using an HTML template dynamically, and populate it with data fetched from the model.
The view is managed by urls.py and views.py.

Template

A Template is a text file that defines the structure or layout of the user interface. The text file can be any type of file; for example HTML, XML, etc.
It can accept data from the view and render it using jinja syntax.
​