def replace(opts, text):
    """Replace certain strings will the supplied text

    `opts` is a dictionary of variables that will be replaced. Similar to
    django, it will look for {{..}} and replace it with the variable value

    Since we want to maintance compatibility with django's `startapp` command
    we need to also replaced `app_name` folders with the supplied value.

    """
    if IS_WINDOWS:
        text = text.replace('\\app_name', '\\{0}'.format(opts['APP_NAME']))
        text = text.replace('\\gitignore', '\\.gitignore')
    else:
        text = text.replace('/app_name', '/{0}'.format(opts['APP_NAME']))
        text = text.replace('/gitignore', '/.gitignore')

    for key, value in opts.iteritems():
        if not value:
            continue
        text = text.replace('{{%s}}' % (key.lower(),), value)
    return text