Use efficient datatypes
Presently (presumably as a temporary measure) the only datatype used in the database end is VARCHAR(39), and then straight conversion string -> IPy.IP -> string is used. Obviously this will be much more efficient when more efficient datatypes are used. After exhaustive Googling I have found what I believe to be a list of the "best" (most efficient/consistent) types for each of the databases that Django apparently handles. I will put it as a first comment to this issue, where it can be improved upon, corrected or whatever in subsequent comments. Obviously the code in model.py (and elsewhere) needs to be changed to convert to/from these types too.