{% set indent_increment = 4 %}

{%- macro application_block(value, key=None, operator=' = ', delim='', ind=0) -%}
    {%- if value != None -%}
    {%- if value is number or value is string -%}
        {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
    {%- elif value is mapping -%}
        {{ key|indent(ind, True) }}{{ operator }}{{ '{' }}
        {%- for k, v in value.items() %}
{{ application_block(v, k, operator, delim, (ind + indent_increment)) }}
        {%- endfor %}
{{ '}'|indent(ind, True) }}
    {%- elif value is iterable -%}
        {%- for v in value %}
{{ application_block(v, key, operator, delim, ind) }}
        {%- endfor -%}
    {%- else -%}
        {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
    {%- endif -%}
    {%- else -%}
    {%- endif -%}
{%- endmacro -%}

# uwsgi application configuration
#
# **** DO NOT EDIT THIS FILE ****
#
# This file is managed by Salt.
[uwsgi]
{% for key, value in config.items() %}
{{ application_block(value, key) }}
{%- endfor -%}

{% set indent_increment = 4 %}

{%- macro application_block(value, key=None, operator=' = ', delim='', ind=0) -%}
    {%- if value != None -%}
    {%- if value is number or value is string -%}
        {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
    {%- elif value is mapping -%}
        {{ key|indent(ind, True) }}{{ operator }}
        {%- for k, v in value.items() %}
{{ application_block(v, k, operator, delim, (ind + indent_increment)) }}
        {%- endfor %}
    {%- elif value is iterable -%}
        {%- for v in value %}
{{ application_block(v, key, operator, delim, ind) }}
        {%- endfor -%}
    {%- else -%}
        {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
    {%- endif -%}
    {%- else -%}
    {%- endif -%}
{%- endmacro -%}

# uwsgi application configuration
#
# **** DO NOT EDIT THIS FILE ****
#
# This file is managed by Salt.
[uwsgi]
{% for key, value in config.items() %}
{{ application_block(value, key) }}
{%- endfor -%}

Remove braces for mappable values
Remove braces for mappable values

Braces don't occur in uWSGI INI config.
