mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Add management command to create homepage user
This commit is contained in:
parent
08f0ffd12e
commit
94d99ba174
1 changed files with 14 additions and 0 deletions
14
apps/profile/management/commands/startup.py
Normal file
14
apps/profile/management/commands/startup.py
Normal 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))
|
Loading…
Add table
Reference in a new issue