create_profiles.py 346 B

123456789101112
  1. from django.contrib.auth.models import User
  2. from django.core.management.base import NoArgsCommand
  3. from . import profile
  4. class Command(NoArgsCommand):
  5. help = "Creates profile records for any user that doesn't have them."
  6. def handle_noargs(self, **options):
  7. for user in User.objects.all():
  8. profile.get_profile(user)