Feature suggestion: Option to suppress system checks in commands

63 views
Skip to first unread message

Vlastimil Zíma

unread,
Sep 30, 2016, 4:31:36 AM9/30/16
to Django developers (Contributions to Django itself)
Hi everyone,

I'd suggest an options for all commands to suppress a defined system checks when running a command. I know it is possible to defined SILENCED_SYSTEM_CHECKS in settings, but that has impact of everything including the check command itself. My point is to suppress system checks mainly for cron jobs, so they don't report errors. I don't want to use settings because I don't want to suppress checks for migrate and other commands when deploying new version of application.

I don't want to suppress checks for our commands either, since there is only option to suppress checks completely.

Any support for this feature?

Regards,
Vlastimil

GMail

unread,
Sep 30, 2016, 5:08:14 AM9/30/16
to django-d...@googlegroups.com
Hi, wouldn't it be easier to create special settings for cron? Something like that:


# myprj/settings/cron.py

from myprj.settings import *
SILENCED_SYSTEM_CHECKS = ...


And in cron:

... python manage.py <command> --settings=myprj.settings.cron

--
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/554d79d7-1485-46c7-8ecd-352422382c00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

GMail

unread,
Sep 30, 2016, 5:09:17 AM9/30/16
to django-d...@googlegroups.com
Hi, wouldn't it be easier to create special settings for cron? Something like that:


# myprj/settings/cron.py

from myprj.settings import *
SILENCED_SYSTEM_CHECKS = ...


And in cron:

... python manage.py <command> --settings=myprj.settings.cron
On 30 Sep 2016, at 11:31, Vlastimil Zíma <vlas...@ziima.cz> wrote:

Bogdan Bursuc

unread,
Sep 30, 2016, 7:33:02 AM9/30/16
to Django developers (Contributions to Django itself)
Hi,

You could add the setting through and env variable and obtain that variable inside the settings file with
SILENCED_SYSTEM_CHECKS = bool(os.environ.get("SILENCED_SYSTEM_CHEKS", false))


--
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/554d79d7-1485-46c7-8ecd-352422382c00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Thanks,
Bogdan I. Bursuc

Tim Graham

unread,
Oct 3, 2016, 3:52:53 PM10/3/16
to Django developers (Contributions to Django itself)
I'm interested to know which checks you want to suppress only in some cases?

Vlastimil Zíma

unread,
Oct 4, 2016, 3:48:07 AM10/4/16
to Django developers (Contributions to Django itself)
@bogdan: I don't quite like to use environment variables as configuration, but this is probably the way I'll go. Thanks for pointing it out.

@tim: This time its 'auth.W004'. In order to allow username recycling we have constraint for unique usernames among active user's only. Django doesn't expect this and reports that we don't have unique usernames. Generally I prefer not to suppress checks globally as the same error (warning) may be reported several times, but there is only option to suppress the whole type and not the individual occurence.

VZ

Dne pondělí 3. října 2016 21:52:53 UTC+2 Tim Graham napsal(a):
Reply all
Reply to author
Forward
0 new messages