Add management command to create homepage user

This commit is contained in:
jmath1 2020-06-11 03:00:54 -04:00
parent 08f0ffd12e
commit 94d99ba174

View file

@ -0,0 +1,14 @@
#add homepage user from settings
#add popular user
from settings import HOMEPAGE_USERNAME
from apps.profile.models import create_profile
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
instance = User.objects.create(username=HOMEPAGE_USERNAME)
instance.save()
create_profile(None, instance, None)
print("User {0} created".format(HOMEPAGE_USERNAME))