Please put monitor.py as default in next django version

166 views
Skip to first unread message

Ricardo Prado

unread,
Oct 13, 2016, 9:39:31 PM10/13/16
to Django developers (Contributions to Django itself)
Hy Guys!

A always use monitor.py to developer my django apps, but this file ins't included in django current version. In future this can be included for dev tools.

Thanks.

Aymeric Augustin

unread,
Oct 14, 2016, 3:15:02 AM10/14/16
to django-d...@googlegroups.com
Hello Ricardo,

I looked for monitor.py but I’m not sure what you’re referring to. I don’t know what you call the “dev tools” either; If you’re thinking of the debug toolbar it’s a third party project. To move forwards with this, you’ll have to clarify your suggestion.

Thanks,

-- 
Aymeric.

PS: hopefully you’re writing to all people on this mailing list and not only men. May I suggest “hello folks” rather than “hello guys” for next time? This isn’t a boys’ club.


--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/c32385f6-a105-4fce-b1ec-b856b017cca6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ricardo Prado

unread,
Oct 14, 2016, 7:38:32 PM10/14/16
to Django developers (Contributions to Django itself)
Thanks "Folks" in special Aymeric

Let's go, let me explain about this "monitor.py".

When users deploy django app in production, the changes in any python script need be "reloaded" for apply changes, in this you have two options to do this:

1 - restart apache or nginx server
2 - "touch wsgi.py" (command line linux)

Anyway this is a problem, this file can be included in django core for apply changes in python script and don't need be reload server. When you start a django app

typing: "python manage.py runserver".

An internal montior is initialized for apply changes runtime. Would be good have this option in production too.


Attachment:
monitor.py sample and wsgi.py in usage.

Thanks!
monitor.py
wsgi.py

Florian Apolloner

unread,
Oct 14, 2016, 7:47:52 PM10/14/16
to Django developers (Contributions to Django itself)
Hi,


On Saturday, October 15, 2016 at 1:38:32 AM UTC+2, Ricardo Prado wrote:
An internal montior is initialized for apply changes runtime. Would be good have this option in production too.

I tend to disagree. Having this in production would be kind of bad -- it takes extra resources and does not provide any benefit. After all deployments are a controlled action, reloading your webserver (or whatever your strategy requires) should be part of deployment and not be part of Django (which cannot really know what you WSGI handler needs anyways).

Cheers,
Florian

Jeremy Spencer

unread,
Oct 14, 2016, 8:37:53 PM10/14/16
to Django developers (Contributions to Django itself)
Hello,

I agree with Florian. Deployments are not the same across the board. It is also simple enough to write something like a fabric script that handles your own unique process accordingly.

 This would make an excellent additional package on pypi, but I do not see a reason to include it as a default in Django.

Jeremy

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.

For more options, visit https://groups.google.com/d/optout.
--

---
Jeremy Spencer
www.jeremyspencer.me

Curtis Maloney

unread,
Oct 14, 2016, 8:40:58 PM10/14/16
to django-d...@googlegroups.com


On 15/10/16 08:16, Ricardo Prado wrote:
> Thanks "Folks" in special Aymeric
>
> Let's go, let me explain about this "monitor.py".
>
> When users deploy django app in production, the changes in any python
> script need be "reloaded" for apply changes, in this you have two
> options to do this:
>
> 1 - restart apache or nginx server

Well, no... if you're using apache/mod_wsgi (and have configured it
correctly) you merely need to "touch" the wsgi script.

If you're using nginx, it doesn't run django, so you should be starting
whichever uwsgi service you are using (e.g. uwsgi, gunicorn, waitress, etc)

> Anyway this is a problem, this file can be included in django core for
> apply changes in python script and don't need be reload server. When you
> start a django app
>
> typing: "python manage.py runserver".
>
> An internal montior is initialized for apply changes runtime. Would be
> good have this option in production too.

Most deploy processes and managers would scream at you if you decided to
restart the service every time a file changed.

Typically in production you want to update the whole codebase and have a
controlled reload (is touch really so difficult?)

What sort of situations are you seeing that you want a restart
frequently and more simple than "touch wsgi.py" ?

--
C

Aymeric Augustin

unread,
Oct 15, 2016, 8:08:31 AM10/15/16
to django-d...@googlegroups.com
Hello,

On 15 Oct 2016, at 02:40, Curtis Maloney <cur...@tinbrain.net> wrote:
>
> What sort of situations are you seeing that you want a restart frequently and more simple than "touch wsgi.py" ?

Developing locally with Apache is a common use case, but mod_wsgi handles this: http://modwsgi.readthedocs.io/en/develop/user-guides/reloading-source-code.html

Generally speaking I agree that this doesn’t belong to Django, but for a reason that hasn’t been brought up yet.

This matter is related to the application server, not the framework. It must be solved by each application server, on the other side of the WSGI, not by every framework.

Note that Django provides its own application server for development (runserver) and deals with auto-reloading there.

--
Aymeric.

Reply all
Reply to author
Forward
0 new messages