title: How to correctly execute query in Django?
body: <p>I need to execute the <code>SELECT pg_database_size ('mydatabase')</code> query, how do I do this in Django with the Postgres DBMS?</p>
  
  <p>I already tried doing the following</p>
  
  <pre><code>from django.db import connection
  
  cursor = connection.cursor()
  size = cursor.execute('''SELECT pg_database_size("mydatabase")''')
  
  </code></pre>
  
  <p>But the resulting <code>size</code> is <code>None</code>.</p>
  
  <p>How do I perform this query? The intent is to return the size of the database.</p>