title: How can you define a persistent variable in Django
body: <p>I have a Django project, and what I would like to do is be able to create a reference to a variable defined in <code>urls.py</code> that is kept for the duration of the process.</p>
  
  <p>I've tried an approach using global vars - but for whatever reason, the value of the variable in <code>urls.py</code> is the initial value - even if I change it somewhere else. I've followed the concepts as explained <a href="http://docs.python.org/faq/programming.html#how-do-i-share-global-variables-across-modules" rel="nofollow">here</a>, but just doesn't work.</p>
  
  <p>However, when I try such a scenario outside of Django, it works as expected.</p>
  
  <p>I think I'm missing a trick (or two) with Django - it's great, I'm new to it, and I think I'm going down the wrong path. Should I be using the caching stuff included with Django to store the variable, or is that even more off track?</p>
  
  <p>Many thanks for any pointers.</p>