2

I would like to continuously deploy a django server. The command I run to deploy the server is

python manage.py runserver

However, this command runs as an infinite loop. Therefore, the associated job in the continuous deployment never ends. The problem is that I would like the server to be updated whenever some commit is done. But it won't work here because the next job associated with the commit won't start until the end of the first job.

Is there a solution to this problem?

Ivan Starostin
  • 8,798
  • 5
  • 21
  • 39
Aleph
  • 1,343
  • 1
  • 12
  • 27
  • 1
    That is **not** a command that you should be running to deploy anything. That is for local development only. – Daniel Roseman Apr 08 '19 at 09:18
  • Thank you Daniel. Which command shoud I use then? – Aleph Apr 08 '19 at 09:18
  • 3
    You should use a proper wsgi server - eg gunicorn, mod_wsgi, uwsgi. See [the deployment docs](https://docs.djangoproject.com/en/2.2/howto/deployment/). – Daniel Roseman Apr 08 '19 at 09:20
  • Thank you very much. I will read the documentation you provide and change the deployment process. – Aleph Apr 08 '19 at 09:22
  • 2
    [Here is a guide of how to handle Django settings for local and production environment](https://stackoverflow.com/questions/10664244/django-how-to-manage-development-and-production-settings) – Iakovos Belonias Apr 08 '19 at 09:23
  • Thank you very much! I finally managed to solve my problem using apache and mod-wsgi. :) – Aleph Apr 10 '19 at 10:17

0 Answers0