From this description, I guess that you
- SSH into the server
 
- Run 
python app.py 
- At this point, the app is available
 
- Log off from the SSH connection (e.g. 
exit command) 
- At this point, the app is not available any more
 
If so, this is because the command you run during the SSH session will be terminated when you log off from the session.
There are several ways to keep your app running after you log off. For example,
- Run 
nohup python app.py &. 
- Run 
tmux and run python app.py in the tmux window. Then Ctrl+b+d to close the tmux window. 
In either way, the app will keep running after you log off from the SSH connection. If my guess about your situation is wrong, please elaborate on your situation more in detail. For example, tell us the series of command you run and what happens with them.
In particular, the term "offline" is not clear in this context. If you are completely offline and not connected even to the intranet, then there is no chance that you can use the app running on the server.