1
0
Fork 0
mirror of synced 2024-06-28 11:00:35 +12:00

warn user that no admins exist when starting runserver

This commit is contained in:
Nick Sweeting 2019-04-24 11:38:37 -04:00
parent 03470699d3
commit b0ace38273

View file

@ -7,7 +7,7 @@ __description__ = 'Run the ArchiveBox HTTP server'
import sys
import argparse
from ..legacy.config import setup_django, OUTPUT_DIR, ANSI, check_data_folder
from ..legacy.config import setup_django, IS_TTY, OUTPUT_DIR, ANSI, check_data_folder
from ..legacy.util import reject_stdin
@ -38,7 +38,14 @@ def main(args=None):
setup_django(OUTPUT_DIR)
from django.core.management import call_command
from django.contrib.auth.models import User
if IS_TTY and not User.objects.filter(is_superuser=True).exists():
print('{lightyellow}[!] No admin users exist yet, you will not be able to edit links in the UI.{reset}'.format(**ANSI))
print()
print(' To create an admin user, run:')
print(' archivebox manage createsuperuser')
print()
print('{green}[+] Starting ArchiveBox webserver...{reset}'.format(**ANSI))
if not command.reload: