title: How does one enforce automatic logout due to inactivity in a Django application?
body: <p>In my Django application, I would like for the user to be automatically logged out after 30 minutes of inactivity, so I used this setting in settings.py:</p>
  
  <pre><code>SESSION_COOKIE_AGE = 1800
  </code></pre>
  
  <p>However, using this setting logs the user out in 30 minutes regardless of activity. How does one enforce automatic logout due to inactivity in a Django application?</p>