Custom User model compatibility

From the docs: "Since the User model can be swapped out, you should use this method instead of referencing the username attribute directly."
Merge pull request #9 from spenthil/patch-1

Custom User model compatibility