How do I restart django server that is running in the background?

15,304

It depends how you're running the Django server. If you set the Django server to run with Apache, sudo service apache2 restart will do the trick.

If you're running the test server (manage.py runserver), you could use fg to bring the job into the foreground, and tinker with it, but the Django development server automatically detects changes for you (there's no need to restart).

Share:
15,304
Admin
Author by

Admin

Updated on June 30, 2022

Comments

  • Admin
    Admin almost 2 years

    I run ssh [email protected], change to the django directory for my app and then run ps | aux less. I do not see any processes with python in the command. How do I restart my django server as it is running in the background?

  • ruslaniv
    ruslaniv about 3 years
    If I'm running dev server in a container and there is unrecoverable error, like ModuleNotFoundError then the Django server would not auto reload and I have to do it manually, so I would like to have an option to restart it from cli instead of restarting the whole container.