AWS – How To Redeploy Python API Changes?


GenAI – How To Redeploy Python API Changes?

Table Of Contents:

  1. Steps To Redeploy The Python Changes.

Step-1: Make Your Code Changes

  • Update your FastAPI or Flask code (hardline_main.py, etc.)

Step-2: Stop the Existing Service

sudo systemctl stop hardline.service
  • Update your FastAPI or Flask code (hardline_main.py, etc.)

Step-3: Reload systemd Daemon

sudo systemctl daemon-reload
  • This reloads the service definitions (needed only if you’ve edited .service files).

Step-4: Start the Updated Service

sudo systemctl start hardline.service
  • This starts the service again using your latest code.

Step 5 (Optional but Recommended): Enable Service on Boot

sudo systemctl enable hardline.service

Makes sure your API auto-starts after reboot.

Step-6: Check Service Status

sudo systemctl status hardline.service
  • This lets you confirm:

    • If it’s running

    • If there are any errors or logs

Leave a Reply

Your email address will not be published. Required fields are marked *