title: best practice for multi user flask application
body: <p>I have built a python script that sends users telegram notifications about things happening in their account on another service.</p>
  
  <p>For this a user needs to specify API keys for said service so that my script can pull the required information.</p>
  
  <p>Now currently, for a new user, I manually create a new folder on my VPS, create a new venv, a new settings file and run the application from a screen session named after the user. This is becoming tedious with 10+ users, especially with updates to the script.</p>
  
  <p>I am currently building a flask based website, where users can log in and set their API keys and other parameters on a own dashboard.</p>
  
  <p>What I want to achieve: </p>
  
  <ul>
  <li><p>if user registers, a new entity of the script has to be created with a settings file next to it containing user information</p></li>
  <li><p>the user should have the option to start/stop said application from the dashboard</p></li>
  <li><p>if I release an update to the script I want to deploy it to all users at once and restart their script if it was running</p></li>
  <li><p>basically the flask website should only act as a configuration dashboard/frontend for the script that runs on my server so that people don't need to have an own VPS or leave their private system running 24/7</p></li>
  </ul>
  
  <p>How do I go about this? Is it "just" file handling, creating new folders and files from a blueprint after a user registers? Are there better practices?</p>
  
  <p>I tried to find answers to that via google and the stackoverflow search but I did not find a specific recommendation for that usecase.</p>
  
  <p>If anyone could point me towards a resource on that or even better an example somewhere I'd really appreciate it!</p>
  
  <p>Thanks in advance.</p>