title: How to set up a staging environment on Google App Engine
body: <p>Having properly configured a <em>Development</em> server and a <em>Production</em> server, I would like to set up a <em>Staging</em> environment on Google App Engine useful to test new developed versions live before deploying them to production.</p>
  
  <p>I know two different approaches:</p>
  
  <p><strong>A.</strong> The first option is by modifying the <a href="http://code.google.com/appengine/docs/python/config/appconfig.html" rel="noreferrer">app.yaml</a> <strong>version</strong> parameter.</p>
  
  <pre><code>version: app-staging
  </code></pre>
  
  <p>What I don't like of this approach is that Production data is polluted with my staging tests because (correct me if I'm wrong):</p>
  
  <ol>
  <li>Staging version and Production version share the same Datastore </li>
  <li><strike>Staging version and Production version share the same logs</strike></li>
  </ol>
  
  <p><sub>Regarding the first point, I don't know if it could be "fixed" using the new <a href="http://code.google.com/appengine/docs/python/multitenancy/overview.html" rel="noreferrer">namespaces python API</a>.</sub></p>
  
  <p><strong>B.</strong> The second option is by modifying the <a href="http://code.google.com/appengine/docs/python/config/appconfig.html" rel="noreferrer">app.yaml</a> <strong>application</strong> parameter</p>
  
  <pre><code>application: foonamestaging
  </code></pre>
  
  <p>with this approach, I would create a second application totally independent from the Production version.<br>
  The only drawback I see is that I'm forced to configure a second application (administrators set up).<br>
  With a backup\restore tool like <a href="http://aralbalkan.com/1784" rel="noreferrer">Gaebar</a> this solution works well too.</p>
  
  <p>What kind of approach are you using to set up a staging environment for your web application?<br>
  Also, do you have any automated script to change the yaml before deploying?</p>