Skip to content

Instantly share code, notes, and snippets.

@cromulus
Created July 29, 2014 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cromulus/78536090b343e36c9fba to your computer and use it in GitHub Desktop.
Save cromulus/78536090b343e36c9fba to your computer and use it in GitHub Desktop.
@bp.route('lang',methods=['GET'])
def GET_lang():
"""
Returns the language requested by the browser
defaults to en-US
"""
try:
headers = self.request.headers
return headers['Accept-Language'] || "en-US,en;q=0.8"
except Exceptions as e:
return respond500(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment