Exemple #1
0
    def handle(self, *args, **options):
        self.make_database_faster()
        for msg in create_items(self.placeholders_dir, 40):
            self.stdout.write(msg)
        for msg in create_users(20):
            self.stdout.write(msg)
        for msg in create_orders(20):
            self.stdout.write(msg)

        if options['createsuperuser']:
            credentials = {'email': '*****@*****.**', 'password': '******'}
            user, created = User.objects.get_or_create(
                email=credentials['email'],
                defaults={
                    'is_active': True,
                    'is_staff': True,
                    'is_superuser': True
                })
            if created:
                user.set_password(credentials['password'])
                user.save()
                self.stdout.write('Superuser - %(email)s/%(password)s' %
                                  credentials)
            else:
                self.stdout.write('Superuser already exists - %(email)s' %
                                  credentials)
Exemple #2
0
    def handle(self, *args, **options):
        for msg in create_items(self.placeholders_dir, 10):
            self.stdout.write(msg)
        for msg in create_users(10):
            self.stdout.write(msg)
        for msg in create_orders(20):
            self.stdout.write(msg)

        if options['createsuperuser']:
            user = User.objects.create_superuser(
                email='*****@*****.**', password='******')
            self.stdout.write('Superuser - %s' % user.email)
Exemple #3
0
    def handle(self, *args, **options):
        for msg in create_items(self.placeholders_dir, 10):
            self.stdout.write(msg)
        for msg in create_users(10):
            self.stdout.write(msg)
        for msg in create_orders(20):
            self.stdout.write(msg)

        if options['createsuperuser']:
            credentials = {'email': '*****@*****.**', 'password': '******'}
            user, created = User.objects.get_or_create(
                email=credentials['email'], defaults={
                    'is_active': True, 'is_staff': True, 'is_superuser': True})
            if created:
                user.set_password(credentials['password'])
                user.save()
                self.stdout.write(
                    'Superuser - %(email)s/%(password)s' % credentials)
            else:
                self.stdout.write(
                    'Superuser already exists - %(email)s' % credentials)