0

In our Django project(Django 2.1.5), every time we try to run the project we have to give the '--noreload' command in addition to the runserver command, else the project returns an error as,

ValueError: signal only works in main thread

We are using Django signals to communicate between the apps created in Django and Web-sockets in Threading aysnc-mode to connect between the other services involved in the project. When we try to deploy the project in Jenkins, this becomes a problem and we are using Nginx as the webserver for host the application. Is there any possibility to solve the issue of '--noreload' and run the application normally?

We are not sure if its because of the same problem referred above but we have a problem when trying to migrate the changes in the Models in Django, it always returns

No changes Detected

After a quick internet search, we did the migrations by mentioning the app names and it did work, yet the terminal stays still after the migrating and waits to manually terminate the process.

Is there a possible solution to overcome this? and also we would like to know where we go wrong

harish
  • 21
  • 1
  • 4
  • Do not use `runserver` in production if you do, consider using gunicorn or similar. – funnydman Dec 03 '19 at 07:22
  • Hello @funnydman, we are using uWSGI to run the server but we are facing the problem when the migrations do not happen automatically when 'makemigrations' is given, we have to manually kill the process for that. We are suspecting that the issue woould be because of the --noreload problem. We would like to know if that is the issue and how to solve it. – harish Dec 03 '19 at 07:43
  • Do you have any custom/third-party middleware of something? It would be really helpful if you could create a minimal reproducible example. – funnydman Dec 03 '19 at 08:05
  • @harish I was alerted of this issue recently and wrote it down here: https://github.com/miguelgrinberg/python-engineio/issues/147. This happens when the Socket.IO code is imported for the first time in a thread other than the main one. Will be looking at this soon. – Miguel Grinberg Dec 04 '19 at 15:25
  • @Miguel thank you for letting me know the status of this. Will check in the next update. – harish Dec 06 '19 at 11:56

0 Answers0