Sample systemd unit file for a Python application

[Unit]
Description=My Python web application

[Service]
ExecStart=/usr/bin/python3 /opt/code/my_app.py
ExecStartPre=/opt/code/configure_db.sh
ExecStartPost=/opt/code/email_status.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target