0

nssm service to run django application.

I have created nssm service to run my django app on windows machine but it doesn't work. Please suggest an alternative package or the right config to get the service running. Here is the command I used.

Adding nssm to environment variable

some_shell>setx PATH "%PATH%;C:\Users\app\nssm" /M

Creating nssm service

some_shell>nssm install myappservice

Here I gave C:\Users\django_app\manage.py as path and;

C:\Users\django_app as Startup directory

I get "windows could not start the myappservice on local computer..." error whenever I try to start the service.

7guyo
  • 3,047
  • 1
  • 30
  • 31
  • I'm unfamiliar with nssm, but this answer might prove helpful: https://stackoverflow.com/questions/32404/how-do-you-run-a-python-script-as-a-service-in-windows/46450007#46450007 – schillingt Jan 16 '21 at 21:14
  • @schillingt I followed similar example but i think there's a tweak specific to django environment. – 7guyo Jan 17 '21 at 06:47

1 Answers1

1

Go ahead and select python.exe in your env or venv path and give it "manage.py runserver" as command and set the startup path to your project this way it gets started

Ahmet Emre Kilinc
  • 5,489
  • 12
  • 30
  • 42
moein_py
  • 129
  • 3
  • 8