0

I made a .bat file and using 3rd party app I am running it as a service and in the file the following command :

c:\Python27\python.exe manage.py runserver 8003

which starts the Django's Server, and I want to stop this running server also using command line to stop the Django Server. So is there anyway using CMD to stop running server, because I want to automate the whole process beside other stuff.

NFAL
  • 175
  • 1
  • 16
  • 2
    You are not supposed to do this sort of thing with the development server – e4c5 Jun 14 '17 at 13:13
  • @e4c5 Well Acutally it a webapp and I need to pull updates to the Git repo, the Process is : Stop there Server, Pull updates, Start the server once again. And this should be all automated, but I don't know how to stop the running server – NFAL Jun 14 '17 at 13:22
  • It sounds like you're looking for a tutorial on creating an automated build process (which is off-topic). But either way you shouldn't be using the development server in production – Sayse Jun 14 '17 at 13:24
  • @Sayse that is my part of work to do the process, but I am clear with my question. I just need windows command to stop Django servre. – NFAL Jun 14 '17 at 13:27
  • thanks but I found the answer: ` for /f "tokens=5" %a in ('netstat -aon ^| find "8003"') do taskkill /f /pid %a` – NFAL Jun 14 '17 at 13:52

0 Answers0