views:

220

answers:

1

Is it possible to fetch the current application version programmatically for use in urls with far future expires header?

For example:

<link rel="stylesheet" href="app.js?v=1.23" />

Should be automatically updated to:

<link rel="stylesheet" href="app.js?v=1.24" />

In order to do so I need to get the version.

+2  A: 

From [http://code.google.com/appengine/docs/python/theenvironment.html][1]

from google.appengine.ext import webapp
import os

class PrintEnvironmentHandler(webapp.RequestHandler):
  def get(self):
    for name in os.environ.keys():
      self.response.out.write("%s = %s<br />\n" % (name, os.environ[name]))


  [1]: http://code.google.com/appengine/docs/python/theenvironment.html
SM79
Thanks! I have been looking all over the appengine site and have been unable to find this for some reason.
brad