Adds site settings to initdb

This commit is contained in:
Mouse Reeve 2020-12-12 16:01:43 -08:00
parent b8d9e2eb24
commit 9b7f0366e7

View file

@ -2,7 +2,7 @@ from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from bookwyrm.models import Connector, User
from bookwyrm.models import Connector, SiteSettings, User
from bookwyrm.settings import DOMAIN
def init_groups():
@ -73,7 +73,7 @@ def init_connectors():
identifier='bookwyrm.social',
name='BookWyrm dot Social',
connector_file='bookwyrm_connector',
base_url='https://bookwyrm.social' ,
base_url='https://bookwyrm.social',
books_url='https://bookwyrm.social/book',
covers_url='https://bookwyrm.social/images/covers',
search_url='https://bookwyrm.social/search?q=',
@ -91,10 +91,14 @@ def init_connectors():
priority=3,
)
def init_settings():
SiteSettings.objects.create()
class Command(BaseCommand):
help = 'Initializes the database with starter data'
def handle(self, *args, **options):
init_groups()
init_permissions()
init_connectors()
init_connectors()
init_settings()