old_contents: import pdb
  import logging
  import urllib
  import pdb
  import os
  import sys
  import pytesseract
  import requests
  
  from forms import *
  from PIL import Image
  from logging import Formatter, FileHandler
  from flask import Flask, render_template, request, jsonify
  from ocr import process_image
  from StringIO import StringIO
  
  app = Flask(__name__)
  
  @app.route('/ocr', methods=["POST"])
  def ocr():
      try:
          url = request.form.keys()[0]
          pdb.set_trace()
          output = process_image(url)
          return jsonify(output)
      except:
          return jsonify({"error":"ocr error with image, did you send the proper url?"})
  
  @app.errorhandler(500)
  def internal_error(error):
      print str(error)
  
  @app.errorhandler(404)
  def not_found_error(error):
      print str(error)
  
  if not app.debug:
      file_handler = FileHandler('error.log')
      file_handler.setFormatter(
          Formatter('%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]')
      )
      app.logger.setLevel(logging.INFO)
      file_handler.setLevel(logging.INFO)
      app.logger.addHandler(file_handler)
      app.logger.info('errors')
  
  if __name__ == '__main__':
      a = process_image("http://www.juncha.net/wp-content/uploads/2014/06/lionking_juncha2.jpg")
      port = int(os.environ.get('PORT', 5000))
      app.run(host='0.0.0.0', port=port)
  
new_contents: import pdb
  import logging
  import urllib
  import pdb
  import os
  import sys
  import pytesseract
  import requests
  
  from forms import *
  from PIL import Image
  from logging import Formatter, FileHandler
  from flask import Flask, render_template, request, jsonify
  from ocr import process_image
  from StringIO import StringIO
  
  app = Flask(__name__)
  
  @app.route('/ocr', methods=["POST"])
  def ocr():
      try:
          return jsonify(process_image(request.form.keys()[0]))
      except:
          return jsonify({"error":"ocr error with image, did you send the proper url?"})
  
  @app.errorhandler(500)
  def internal_error(error):
      print str(error)
  
  @app.errorhandler(404)
  def not_found_error(error):
      print str(error)
  
  if not app.debug:
      file_handler = FileHandler('error.log')
      file_handler.setFormatter(
          Formatter('%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]')
      )
      app.logger.setLevel(logging.INFO)
      file_handler.setLevel(logging.INFO)
      app.logger.addHandler(file_handler)
      app.logger.info('errors')
  
  if __name__ == '__main__':
      port = int(os.environ.get('PORT', 5000))
      app.run(host='0.0.0.0', port=port)
  
subject: update app to use simplified ocr