title: django + mysql, storing ip address including ranges
body: <p>I need an efficient way to store IP address.<br>
  The query I would like to do is if IP is in the table (or in range).<br>
  I need to store ranges like,  </p>
  
  <pre><code>192.168.0.1 - 192.168.1.255  
  </code></pre>
  
  <p>And also individual IPs.</p>
  
  <p>Since there are many records I think it will be a waste to store them one by one. But I would go for that if that would be the best.
  Django does have <a href="https://docs.djangoproject.com/en/1.10/ref/models/fields/#genericipaddressfield" rel="nofollow noreferrer">GenericIPAddressField</a> field, but it does not store ranges.</p>
  
  <p>So what is my best solution?</p>