mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
warn user that no admins exist when starting runserver
This commit is contained in:
parent
03470699d3
commit
b0ace38273
1 changed files with 8 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue