Updating files without web server restart

96 views
Skip to first unread message

Thiago Parolin

unread,
Mar 13, 2017, 9:26:52 AM3/13/17
to django...@googlegroups.com
We have a small webserver that is used by many projects (php) from many users.
Now, i am hosting a django project.

The problem is:
 - when user changed some file in his project, the apache continues serving old file until restart the httpd service.
 - the users don't have sudo access, and i don't want to give this power to them.

How can i make apache identify changes without restart?
I never had this problem with php before, and i am totally new to django...
Sorry if this question is more about apache than django.
Thanks.

Avraham Serour

unread,
Mar 13, 2017, 9:30:01 AM3/13/17
to django-users
you may use uwsgi and tell uwsgi to gracefully reload, it won't even close any eventual tcp sockets, they will wait until the new code is loaded, users will never now you reloaded the application

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACTnJ00E8bUSWxW_9-VrDb_ikfJ_tzSXWgrq431OWGhsvd8gkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Antonis Christofides

unread,
Mar 13, 2017, 9:33:26 AM3/13/17
to django...@googlegroups.com

Are you using mod_wsgi? http://modwsgi.readthedocs.io/en/develop/user-guides/reloading-source-code.html has information on how to have it reload the code.

Antonis Christofides
+30-2118000592 (work)
+30-6979924665 (mobile)
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

Thiago Parolin

unread,
Mar 13, 2017, 9:47:13 AM3/13/17
to django...@googlegroups.com
Thanks a lot to all!
I will try uwsgi and i will read about mod_wsgi to know who is the best to my needs and will solve my problem.


Antonis Christofides

unread,
Mar 13, 2017, 10:12:47 AM3/13/17
to django...@googlegroups.com

Hello,

1) My opinion is that uwsgi is difficult without offering any equivalent advantage. The WSGI server I usually recommend is Gunicorn. I've explained this in Which WSGI server should I use? If you start Gunicorn with the --reload option, it automatically reloads files when changed.

2) However, I don't recommend to change WSGI server just for this reason, especially if mod_wsgi also has this functionality.

Regards,

A.

Antonis Christofides
http://djangodeployment.com
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages