title: What is the best practice for storing UI messaging strings in Python/Django?
body: <p>I'm wondering what the "best practice" is for storing medium length strings to be used in a UI in Python/Django.</p>
  
  <p>Example:
  I have an <code>error.html</code> template that takes an <code>error_description</code> field. This is a few sentences explaining to the user what went wrong, and what they might do to address it. It may be different for different error pages, but remains fairly stable in the code(there's no reason that someone who can't push source code should be able to modify it), and can easily be held in memory, so I don't think it's the sort of thing that should be kept in the database.</p>
  
  <p>My current idea is that I should just create some kind of <code>messages.py</code> file that has a bunch of string constants like this:</p>
  
  <pre><code>ERROR_UNAUTHENTICATED_AJAX_EXPLANATION = "Hello, so the only way that this error should occur is if someone attempts to directly call our AJAX endpoint without having the verification code. Please don't do this, it's against the principles of this art projects."
  </code></pre>
  
  <p>In general, is there some canonical way to store strings that are "too flexible to be hard coded in", but "too small and static for databases"(and don't scale with your usage)? I'm thinking of the sort of thing that would be in a <code>strings.xml</code> file in an Android project. </p>
  
  <p>Other possibilities I'm juggling include a text file that views.py reads and stores as constants, actually just hardcoding them, and sticking them in template files.</p>
  
  <p>There's a lot of ways to do this, and it's not a very complicated thing, I just want to know which one is the most 'right'.</p>
  
  <p>Thanks! And let me know if you need more info!</p>