Python: format string with custom delimiters
<p><strong>EDITED</strong></p>

<p>I have to format a string with values from a dictionary but the string already contains curly brackets. E.g.:</p>

<pre><code>raw_string = """
    DATABASE = {
        'name': '{DB_NAME}'
   }
"""
</code></pre>

<p>But, of course, <code>raw_string.format(my_dictionary)</code> results in KeyErro.</p>

<p>Is there a way to use different symbols to use with <code>.format()</code>?</p>

<p>This is not a duplicate of <a href="https://stackoverflow.com/questions/5466451/how-can-i-print-literal-curly-brace-characters-in-python-string-and-also-use-fo">How can I print literal curly-brace characters in python string and also use .format on it?</a> as I need to keep curly brackets just as they are and use a different delimiter for <code>.format</code>.</p>