Django runserver permanent

后端 未结 8 472
-上瘾入骨i
-上瘾入骨i 2020-12-07 09:54

How can I make the development server from django running permanent? So that it does\'t stop when I quit the shell.

Thanks

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 10:18

    another easy way to do this is to run:

    [user@host]$screen
    [user@host]$python manage.py runserver 0.0.0.0:8000
    

    Now press Ctrl+A and then press d to exit from this screen.

    This creates the server in a screen and then detaches it. This way you can simply go back in and type:

    [user@host]$screen -r
    

    and you can take control of the server again and see whats going on.

    You can also detach from the screen immediately:

    screen -d -m python manage.py runserver 0.0.0.0:8000
    

提交回复
热议问题