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/
>> msgid/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/
> msgid/django-developers/CAMyDDM1CeOVQoH8jN35OwxOJUbhVr
> 99gMtchgFsxbPZXac2tcw%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.
For more options, visit https://groups.google.com/d/optout.