>
> I believe this also can be used by Django itself as there are some cases
> where contrib apps override core command functionality (I believe this
> happens for staticfiles app overriding runserver)
>

The signals as proposed can't really be used for the staticfiles override,
since that requires subclassing and wrapping a function to change the
handler ( source
<https://github.com/django/django/blob/master/django/contrib/staticfiles/management/commands/runserver.py>
). If there are other use cases I think they'd also normally be better
handled by more specific signals, e.g. post_migrate
<https://github.com/django/django/blob/3c447b108ac70757001171f7a4791f493880bf5b/django/db/models/signals.py#L59>,
rather than a generic all-commands signal.

On 16 January 2017 at 12:52, Dmitry Gladkov <[email protected]>
wrote:

> Hello,
>
> While I was reading this email I got an idea about generic Django command
> signals that might be useful for extending command functionality without
> subclassing the Command class and relying on INSTALLED_APPS order.
> Something like this:
>
> from django.core.management.signals import pre_command, post_command
>
> def handle_pre(sender, instance):
>     instance.stdout.write('Hello World')
>
> def handle_post(sender, instance):
>     instance.stdout.write('Bye World')
>
> pre_command.connect(handle_pre, command='runserver')
> post_command.connect(handle_post, command='runserver')
>
> I believe this also can be used by Django itself as there are some cases
> where contrib apps override core command functionality (I believe this
> happens for staticfiles app overriding runserver)
>
> Should I create a ticket about it?
>
> --
> Best wishes,
> Dmitry Gladkov
>
> On 16 January 2017 at 14:47, Adam Johnson <[email protected]> wrote:
>
>> Hi Mathieu,
>>
>> We implemented something similar at YPlan but discovered that it wasn't a
>> good idea as a system check, because if a dependency changes from another
>> devs work then often Django can't even start and run the system check.
>> Especially a problem when upgrading Django itself! Instead we implemented
>> it as a function that runs in manage.py before Django is even loaded.
>>
>> We open sourced our work as https://github.com/YPlan/pip-lock . Check it
>> out.
>>
>> On Mon, 16 Jan 2017 at 04:18, mathieu.tortuyaux <
>> [email protected]> wrote:
>>
>>> Hello everyone,
>>>
>>> I would propose this new Django feature. Now you can check if your
>>> dependencies are up-to-date (e.g with `hypothesis` in attachment picture)
>>> (it runs with Python2.7 && Python3.6).
>>> It is a good habit to check if dependencies are up-to-date, especially
>>> for security reasons.
>>>
>>> I did not find any references about this in Django issues
>>>
>>> So I wondering if I can have any feedback on this ?
>>>
>>> Thank you for taking time to read these words.
>>>
>>> Mathieu Tortuyaux
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>> 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 [email protected].
>>>
>>>
>>> To post to this group, send email to [email protected].
>>>
>>>
>>> Visit this group at https://groups.google.com/group/django-developers.
>>>
>>>
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-developers/5a6fb42e-e5c8-4608-9b20-19fc829473b1%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-developers/5a6fb42e-e5c8-4608-9b20-19fc829473b1%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-developers/CAMyDDM1CeOVQoH8jN35OwxOJUbhVr99gMtchg
>> FsxbPZXac2tcw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-developers/CAMyDDM1CeOVQoH8jN35OwxOJUbhVr99gMtchgFsxbPZXac2tcw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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/CA%2BkbqrUn%2BRnpfuO48WSo%2B8rrtxy%3D%2BUyQK%
> 2Btn14ADbN2m5NcGtQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-developers/CA%2BkbqrUn%2BRnpfuO48WSo%2B8rrtxy%3D%2BUyQK%2Btn14ADbN2m5NcGtQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CAMyDDM0Q_96bLVt9iQjcH-hK6Mfp0otLof27R9CWEDR9R_0UdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to