title: Django: Detect database backend
body: <p>I'm doing some "extra" queries in Django that need to work on both sqlite and postgres. The syntax of these queries varies between backend but I have no way of figuring out if I'm sending my queries to either postgres or sqlite.</p>
  
  <p>Is there a way to get the current database adapter so I can branch my code and send the right query for the active database server?</p>