title: PermissionError: [Errno 13] Permission denied: '/var/www/FlaskApp/FlaskApp/conversationLogs/42779251.json'
body: <p>I am running trying to deploy a flask app on ubuntu using this blog</p>
  <p><a href="https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps" rel="nofollow noreferrer">Deploy a flask app on ubuntu VPS</a></p>
  <p>the static code runs smoothly but when I integrated my code into it I faced a lot of issues and finally, I'm stuck with this final one where I want to read a son and if JSON is not present then create it but getting the same error</p>
  <p><strong>[wsgi:error] [pid 17042:tid 140183924913920] [client x.127.x.235:10100] PermissionError: [Errno 13] Permission denied: '/var/www/FlaskApp/FlaskApp/Json/abcs.json'</strong></p>
  <p>I have tried the following steps from various StackOverflow suggestions:</p>
  <ol>
  <li>Sudo chmod -R 777 /var/www</li>
  <li>using base_dir = os.path.abspath(os.path.dirname(<strong>file</strong>)) then adding /Json/abcs.json in the path to access the file.</li>
  </ol>
  <p>Nothing has worked for me</p>