title: How to remove spaces from string in django template
body: <p>How do you remove all spaces from a string value in a django template?</p>
  
  <p>For example </p>
  
  <pre><code>&lt;a href="www.somesite.com/lookup?id={{ order.id }}"&lt;/a&gt;
  </code></pre>
  
  <p>The order number may have spaces in it and how the templates encodes them breaks the lookup function of the site. (Not our site so can't fix that end)</p>
  
  <p>I'm aware that you can use order.id.strip to get rid of the spaces at the front and end but we need to remove them from the middle of the string as well. </p>
  
  <p>I'm also aware that we could create a custom filter to do it but we like to avoid custom filters for one-off things like this.</p>