[Answer]-Creating custom command line in django that does not check database connectivity

1👍

NVM, I looked at source code for the command “shell” and saw “requires_model_validation” parameter. I used it in my command and it went through, here is an example

class Command(NoArgsCommand):
    args = '<No arguments>'
    help = 'This command will init the database.'
    requires_model_validation = False

    def handle(self, *args, **options):
        try:
            print 'ss'
        except Exception :
            raise CommandError('Cannot find default database settings')

Leave a comment