'Run the setup command, if necessary.
It\'s necessary if the Settings model doesn\'t have a "database_version" or if that version doesn\'t match
kalite.version.VERSION, indicating the source has been changed. Then setup is run to create/migrate the db.'

def setup_server_if_needed(self):

    try:
        from kalite.version import VERSION
        assert (Settings.get('database_version') == VERSION)
    except (DatabaseError, AssertionError):
        from django import db
        db.close_connection()
        logger.info('Setting    up    KA    Lite;    this    may    take    a    few    minutes;    please    wait!\n')
        call_command('setup', interactive=False)
        assert (Settings.get('database_version') == VERSION), 'There    was    an    error    configuring    the    server.    Please    report    the    output    of    this    command    to    Learning    Equality.'
