As you want your application to run autonomously (if I understood correctly), you can handle this as with any other (non-web application).
, , , , -, ( ).
, " " ( ), script. , , . , python my_app.py & ( script), $!, pid , , " pid" kill ( SIGINT KeyboardInterrupt, ).
EDIT:
, , python main.py & , , /, (, Apache , ). , , , , , .
stdout/stderr, script (python main.py &> /path/to/app.log &) , logging.