0

I just made some changes over 1 python file in my production server, then tested the changes using "runserver" command:

python3 manage.py runserver 0.0.0.0:3031

The changes are done correctly, then I try to see the same changes in production but using websockets with Django Channels, but the result seems to be that the server is running the old code.

nohup daphne -b 0.0.0.0 -p 3031 asgi:channel_layer &
nohup python manage.py runworker &

What could be the reason, is there any code cache?, what can I do to refresh the code?

Led Machine
  • 7,122
  • 3
  • 47
  • 49

1 Answers1

0

I found that the solution was to kill all "python runworkers" processes, and then restart the server with daphne and runworker.

sudo pkill python
nohup daphne -b 0.0.0.0 -p 3031 asgi:channel_layer &
nohup python manage.py runworker &
Led Machine
  • 7,122
  • 3
  • 47
  • 49
  • would this command `sudo pkill python` kill another python instance that already running? what if I have multiple python workers running on different projects? how can I specify those processes & workers for each of my projects? any idea? – iColdPlayer Dec 11 '20 at 11:58