@@ -0,0 +1,667 @@
+from django.db.models import Q, Count%0Afrom django.core.management.base import BaseCommand%0Afrom accounts.models import User%0A%0A%0Aclass Command(BaseCommand):%0A    def handle(self, *args, **kwargs):%0A        users = (%0A            User.objects%0A            .annotate(game_count=Count('gamelibrary__games'))%0A            .filter(%0A                Q(website__icontains='.ru') %7C Q(website__icontains='wp-content'),%0A                email_confirmed=False,%0A                game_count=0%0A            )%0A        )%0A%0A        cleared_users = len(users)%0A        for user in users:%0A            print user, user.website%0A            user.delete()%0A        print %22Cleared %25d users%22 %25 cleared_users%0A

Add task to delete spam accounts