Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyDev and Django: how to restart dev server?

I'm new to Django. I think I'm making a simple mistake.

I launched the dev server with Pydev:

RClick on project >> Django >> Custom command >> runserver

The server came up, and everything was great. But now I'm trying to stop it, and can't figure out how. I stopped the process in the PyDev console, and closed Eclipse, but web pages are still being served from http://127.0.0.1:8000.

I launched and quit the server from the command line normally:

python manage.py runserver

But the server is still up. What am I doing wrong here?

like image 644
Nick Heiner Avatar asked Apr 30 '10 17:04

Nick Heiner


People also ask

How do I close Django server?

Though the message in the console states that Ctrl+Break should be used to quit the server, it is not possible; one can only use Ctrl+F4 works to close the console.


2 Answers

By default, the runserver command runs in autoreload mode, which runs in a separate process. This means that PyDev doesn't know how to stop it, and doesn't display its output in the console window.

If you run the command runserver --noreload instead, the auto-reloader will be disabled. Then you can see the console output and stop the server normally. However, this means that changes to your Python files won't be effective until you manually restart the server.

like image 116
interjay Avatar answered Oct 04 '22 19:10

interjay


Run the project 1. Right click on the project (not subfolders) 2. Run As > Pydev:Django

Terminate 1. Click terminate in console window

The server is down

like image 32
Artur Avatar answered Oct 04 '22 17:10

Artur