mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-30 01:30:15 +02:00
allow passing debug flag to archivebox server
This commit is contained in:
@@ -33,12 +33,18 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
help='Enable auto-reloading when code or templates change',
|
help='Enable auto-reloading when code or templates change',
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--debug',
|
||||||
|
action='store_true',
|
||||||
|
help='Enable DEBUG=True mode with more verbose errors',
|
||||||
|
)
|
||||||
command = parser.parse_args(args or ())
|
command = parser.parse_args(args or ())
|
||||||
reject_stdin(__command__, stdin)
|
reject_stdin(__command__, stdin)
|
||||||
|
|
||||||
server(
|
server(
|
||||||
runserver_args=command.runserver_args,
|
runserver_args=command.runserver_args,
|
||||||
reload=command.reload,
|
reload=command.reload,
|
||||||
|
debug=command.debug,
|
||||||
out_dir=pwd or OUTPUT_DIR,
|
out_dir=pwd or OUTPUT_DIR,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -991,6 +991,11 @@ def server(runserver_args: Optional[List[str]]=None,
|
|||||||
runserver_args = runserver_args or []
|
runserver_args = runserver_args or []
|
||||||
check_data_folder(out_dir=out_dir)
|
check_data_folder(out_dir=out_dir)
|
||||||
|
|
||||||
|
if debug:
|
||||||
|
os.environ['DEBUG'] = 'True'
|
||||||
|
else:
|
||||||
|
runserver_args.append('--insecure')
|
||||||
|
|
||||||
setup_django(out_dir)
|
setup_django(out_dir)
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
Reference in New Issue
Block a user