How to stop internal django server

10,812 views
Skip to first unread message

Hingarajiya,Ravi

unread,
Sep 28, 2008, 4:23:08 PM9/28/08
to django...@googlegroups.com
Hi All,

I am very new in Django Framework.

I want to know how to stop internal server without ctrl+c. 

For start command : python manage.py runserver
What is stop command ?

Ravi Hingarajiya

Alessandro Ronchi

unread,
Sep 28, 2008, 4:25:05 PM9/28/08
to django...@googlegroups.com
2008/9/28 Hingarajiya,Ravi <rhinga...@gmail.com>:

It's a process, so you can stop it like any other linux process:
killall python
ps aux | grep python and then kill #numproc
ctrl + c

and so on

--
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net

SOASI Soc.Coop. - www.soasi.com
Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
Tel.: +39 0543 798985 - Fax: +39 0543 579928

Rispetta l'ambiente: se non ti è necessario, non stampare questa mail

Alessandro

unread,
Sep 28, 2008, 4:25:25 PM9/28/08
to django...@googlegroups.com
2008/9/28 Alessandro Ronchi <alessand...@soasi.com>:

Hingarajiya,Ravi

unread,
Sep 28, 2008, 5:37:13 PM9/28/08
to alessand...@soasi.com, django...@googlegroups.com
Hi Alessandro,
 
   Thanks for your reply.I know kill command.
  
  But  we are developing IDE for Django. So We want to know that how to stop internal server using any command (example : /etc/init.d/httpd stop in apache web server ).

Ravi Hingarajiya.

Jeff Anderson

unread,
Sep 28, 2008, 5:41:23 PM9/28/08
to django...@googlegroups.com
Hingarajiya,Ravi wrote:
> Hi Alessandro,
>
> Thanks for your reply.I know kill command.
>
> But we are developing IDE for Django. So We want to know that how
> to stop internal server using any command (example : /etc/init.d/httpd
> stop in apache web server ).
/etc/init.d/httpd stop is just a wrapper script that uses the kill
command. You need to do the same thing to kill any process. ctrl+c sends
signal 2 to the running process. kill <pid> is exactly what you need to use.

Jeff Anderson

signature.asc

Hingarajiya,Ravi

unread,
Sep 28, 2008, 5:44:22 PM9/28/08
to django...@googlegroups.com
Jeff :

  Thanks for reply.

Ravi Hingarajiya

Alessandro

unread,
Sep 29, 2008, 8:03:20 AM9/29/08
to Hingarajiya,Ravi, django...@googlegroups.com
2008/9/28 Hingarajiya,Ravi <rhinga...@gmail.com>:

> Hi Alessandro,
>
> Thanks for your reply.I know kill command.
>
> But we are developing IDE for Django. So We want to know that how to stop
> internal server using any command (example : /etc/init.d/httpd stop in
> apache web server ).

The httpd stop in init.d does a kill:

stop() {
echo -n $"Stopping $prog: "
killproc -d 10 $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}

the pid is stored in /etc/httpd/run/httpd.pid

so you can copy the same script for django-devel runserver, but I
think it's not useful because you can call the command within the ide,
see the pid and then call the kill to proc.

Reply all
Reply to author
Forward
0 new messages