title: python sqlite3 OperationalError: attempt to write a readonly database
body: <p>I am trying to run a Flask REST service on CentOS Apache2 using WSGI. The REST service requires a very small storage. So i decided to use SQLite with <code>sqlite3</code> python package. The whole application worked perfectly well on my local system and on the CentOS server when ran using <code>app.run()</code>. But when i used WSGI to host the application on Apache, i am getting</p>
  
  <pre><code>OperationalError: attempt to write a readonly database
  </code></pre>
  
  <p>I have checked the permissions of the file. The user and group of the file are set to apache (under which the server is running) using <code>chown</code> and<code>chgrp</code>. Also, the file has <code>rwx</code> permission. Still i am getting read-only database error. Following is what i get by running <code>ls -al</code> on the db file:</p>
  
  <pre><code>-rwxrwxrwx. 1 apache apache 8192 Nov 19 01:39 dbfile.db
  </code></pre>
  
  <p>My Apache Configuration:</p>
  
  <pre><code>&lt;VirtualHost *&gt;
  ServerName wlc.host.com
  
  WSGIDaemonProcess wlcd
  WSGIScriptAlias / /var/www/html/wlcd.wsgi
  RewriteEngine on
  RewriteCond %{HTTP:Authorization} ^(.*)
  RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
  &lt;Directory /var/www/html/&gt;
      WSGIProcessGroup wlcd
      WSGIApplicationGroup %{GLOBAL}
      Order deny,allow
      Allow from all
      Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p></p>