Пример #1
0
 def handle(self, *args, **options):
     for name in args:
         user = UserProfile()
         print("Creating user " + name)
         mail = input("E-Mail: ")
         password = input("Password: "******": ")
         user.website = input(user._meta.get_field_by_name('website')[0].verbose_name + ": ")
         user.phone = input(user._meta.get_field_by_name('phone')[0].verbose_name + ": ")
         user.address = input(user._meta.get_field_by_name('address')[0].verbose_name + ": ")
         user.city = input(user._meta.get_field_by_name('city')[0].verbose_name + ": ")
         user.state = input(user._meta.get_field_by_name('state')[0].verbose_name + ": ")
         user.zip = input(user._meta.get_field_by_name('zip')[0].verbose_name + ": ")
         user.country = input(user._meta.get_field_by_name('country')[0].verbose_name + ": ")
         user.user = User.objects.create_user(username=name, email=mail,  password=password)
         user.save()
Пример #2
0
 def handle(self, *args, **options):
     for name in args:
         user = UserProfile()
         print("Creating user " + name)
         mail = input("E-Mail: ")
         password = input("Password: "******": ")
         user.website = input(
             user._meta.get_field('website').verbose_name + ": ")
         user.phone = input(
             user._meta.get_field('phone').verbose_name + ": ")
         user.address = input(
             user._meta.get_field('address').verbose_name + ": ")
         user.city = input(user._meta.get_field('city').verbose_name + ": ")
         user.state = input(
             user._meta.get_field('state').verbose_name + ": ")
         user.zip = input(user._meta.get_field('zip').verbose_name + ": ")
         user.country = input(
             user._meta.get_field('country').verbose_name + ": ")
         user.user = User.objects.create_user(username=name,
                                              email=mail,
                                              password=password)
         user.save()