o a @sHddlmZddlmZddlmZddlmZmZGdddeZ dS))apps)checks)registry) BaseCommand CommandErrorc@s$eZdZdZgZddZddZdS)Commandz8Checks the entire Django project for potential problems.cCsp|jdddd|jddddd d |jd d d d|jdd dd|jddgddd|jddddd dS)Nargs app_label*)metavarnargsz--tagz-tappendtagsz'Run only checks labeled with given tag.)actiondesthelpz --list-tags store_truezList available tags.)rrz--deployzCheck deployment settings.z --fail-levelERROR)CRITICALrWARNINGINFODEBUGz[Message level that will cause the command to exit with a non-zero status. Default is ERROR.)defaultchoicesrz --database databasesz2Run database related checks against these aliases.) add_argument)selfparserrG/usr/lib/python3/dist-packages/django/core/management/commands/check.py add_arguments s.  zCommand.add_argumentsc s|d|dr|jdttdS|r"dd|D}nd}|d}|rGz tfdd|D}Wn ty@Ynwtd ||j ||d t t |d |d d dS)Ndeploy list_tags cSsg|]}t|qSr)rget_app_config).0r rrr /sz"Command.handle..rc3s |] }t|s|VqdS)N)r tag_exists)r%taginclude_deployment_checksrr 6s   z!Command.handle..z+There is no system check with the "%s" tag.T fail_levelr) app_configsrdisplay_num_errorsr*r,r) stdoutwritejoinsortedrtags_availablenext StopIterationrcheckgetattrr)r app_labelsoptionsr-r invalid_tagrr)rhandle(s2     zCommand.handleN)__name__ __module__ __qualname__rrequires_system_checksr r;rrrrrs  rN) django.appsr django.corerdjango.core.checks.registryrdjango.core.management.baserrrrrrrs