def METHOD_NAME(database_name, environment_name):
    from logical.models import Database
    from system.models import Configuration
    databases = Database.objects.filter(name=database_name)
    if not databases:
        return False
    dev_envs = Configuration.get_by_name_as_list('dev_envs')
    if environment_name in dev_envs:
        return False
    prod_envs = Environment.prod_envs()
    return any((
        database.environment.name in prod_envs
        for database in databases))