Run an ArchiveBox Django management command
(args: Optional[List[str]]=None, out_dir: Path=OUTPUT_DIR)
| 1347 | |
| 1348 | @enforce_types |
| 1349 | def manage(args: Optional[List[str]]=None, out_dir: Path=OUTPUT_DIR) -> None: |
| 1350 | """Run an ArchiveBox Django management command""" |
| 1351 | |
| 1352 | check_data_folder(out_dir=out_dir) |
| 1353 | from django.core.management import execute_from_command_line |
| 1354 | |
| 1355 | if (args and "createsuperuser" in args) and (IN_DOCKER and not IS_TTY): |
| 1356 | stderr('[!] Warning: you need to pass -it to use interactive commands in docker', color='lightyellow') |
| 1357 | stderr(' docker run -it archivebox manage {}'.format(' '.join(args or ['...'])), color='lightyellow') |
| 1358 | stderr() |
| 1359 | |
| 1360 | execute_from_command_line([f'{ARCHIVEBOX_BINARY} manage', *(args or ['help'])]) |
| 1361 | |
| 1362 | |
| 1363 | @enforce_types |
no test coverage detected