title: Django + Sqlite: database is locked
body: <p>After a electrical failure my network database having problems</p>
  <p>I open my login page by running the program but after, the username and password are no longer recognized</p>
  <p>I get the error</p>
  <pre><code>Exception Type: DatabaseError
  Value Exception: database is locked
  </code></pre>
  <p>and my function :</p>
  <pre class="lang-py prettyprint-override"><code>def main_page(request):
      state = &quot;&quot;
      username = password = ''
      if request.POST:
          username = request.POST.get('username')
          password = request.POST.get('password')
          user = authenticate(username=username, password=password)
  </code></pre>
  <p>The problem comes from this line : user =....</p>
  <p>How can I fix this ?</p>