Hi Diptesh

The autoreload_started signal looks like the right approach. I see it's not
documented but Django uses it internally for watching template and
translation changes. I think it would be a good idea to document it. I
don't think using the signal hacky, and it's not really a problem that it
requires an AppConfig - it's pretty hard to do anything in Django without
at least one app. Adding another setting is a less preferable solution -
we're trying hard to avoid settings bloat.

django-extensions' runserver_plus command not working with the
auto_reloaded signal is probably django-extensions' problem. The source
code of runserver_plus looks like it has some copy-paste from an older
version of Django's runserver. I suggest you make a PR there if you want
that to work.

Thanks,

Adam

On Mon, 8 Feb 2021 at 02:16, Diptesh Choudhuri <diptesh.choudh...@gmail.com>
wrote:

> I am working on a graphQL project which uses django and ariadne
> <https://ariadnegraphql.org/>. This package supports
> <https://ariadnegraphql.org/docs/modularization#defining-schema-in-graphql-files>
> loading your graphQL schema from external **.graphql *files. While
> developing the schema, I continually change these files and have to restart
> my *runserver *every time I do so, since the changes are not watched by
> default. This obviously gets quickly tiring since designing a GraphQL
> schema takes a lot of iterations.
>
> There is a somewhat hacky fix
> <https://stackoverflow.com/a/43593959/11667450> to this (here's
> <https://github.com/IgnisDa/Gitzer/blob/main/gitzer/director/apps.py#L7>
> an implementation that I used in a project), but the problem with it is
> that it does not work at all for extensions like *django_extension's
> runserver *command. Additionally, it requires you to have to start an
> app, since it is defined in the *AppConfig, *something which might be
> inconvenient to some people.
>
> I propose we add a *AUTORELOADER_ADD_FILES *variable to the *settings.py *file
> which should be a Linux glob (eg: *AUTORELOADER_ADD_FILES = **BASE_DIR /
> "**/*.graphql"*).
>
> If approved, I would like to make a PR for the same.
>
> Regards
> Diptesh Choudhuri
>
> --
> 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-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/0164ea90-33a2-4ee5-b6cd-df508b6ab013n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/0164ea90-33a2-4ee5-b6cd-df508b6ab013n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
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 django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM1h6vR6ncAu-D--AquGphDJVvpKydMkjJiHZw3MMg1k3A%40mail.gmail.com.
  • Add... Diptesh Choudhuri
    • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
    • ... Tom Forbes
      • ... Diptesh Choudhuri

Reply via email to