title: Python: encode/decode a string in Django
body: <p>If I have a string <code>FOOBAR-efkem4x-dnj3mn-efjn2j-lf4m2l</code> (in this format) I need to convert into a shorter string consisting of just numerical values <code>[0-9]</code> so I can put it as a unique number in the URL for my Django project.</p>
  
  <p>So that string should be converted into something like <code>324982984829</code> (can be higher or lower length, doesn't matter as long it is all numeric). Decoding <code>324982984829</code> should get me back to <code>FOOBAR-efkem4x-dnj3mn-efjn2j-lf4m2l</code>. </p>
  
  <p>The end numerical value should be unique for every unique string.</p>
  
  <p>Is there any way of doing this? </p>