Fix migrations possibly generated by a later version of South

Signed-off-by: David Greaves <david.greaves@jolla.com>
Projects needs to be lazily declared
Syntax error in utils

Signed-off-by: David Greaves <david.greaves@jolla.com>