Search code examples
pythonpython-3.xpm2

pm2 json file format for python script


I have a command to execute python manage.py runserver 0:8000 --insecure using PM2 on a server.I'm unable to create the JSON file format so that i can run using that json file in place of writing the entire command.


Solution

  • ecosystem.config.js:

    module.exports = {
      apps : [{
         script: 'manage.py',
         args: 'runserver 0:8000 --insecure'
      }]
    }
    

    Then:

    pm2 start ecosystem.config.js