title: Python web application with flask on local machine
body: <p>I'm new to python and Flask, and I have a project from the production ENV which I'm trying to run on my local.
  I was able to install all the packages and bring them up on <a href="http://127.0.0.1:5000" rel="nofollow noreferrer">http://127.0.0.1:5000</a>, but the problem is that is the only page that actually works on my local. and when I try to do Authorization or even simple post, it does not do anything on my local ( I put some print on the other files and none of them get fire) so I assume they keep going to production as it does have some APIs as well.
  Here is the main page (application.py) which is working on my local.</p>
  <pre><code>import os
  import jwt
  import logging
  from datetime import datetime, timedelta
  
  from http import HTTPStatus
  from pydantic import BaseModel
  from passlib.context import CryptContext
  from flask import Flask, request, jsonify
  from flask_restplus import Api, Resource, fields
  from werkzeug.middleware.proxy_fix import ProxyFix
  from applicationinsights.flask.ext import AppInsights
  
  app = Flask(__name__)
  app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
  api = Api(app, doc='/')
  ns = api.namespace(name='Room Parsing', path='/')
  swaggerTokenParser = api.parser()
  swaggerTokenParser.add_argument('username', location='form')
  swaggerTokenParser.add_argument('password', location='form')
  
  pwd_context = CryptContext(schemes=[&quot;bcrypt&quot;], deprecated=&quot;auto&quot;)
  rtp = RoomTitleParser(room_prototype_XX_path)
  
  ALGORITHM = &quot;HS256&quot;
  
  
  app.config[&quot;SECRET_KEY&quot;] = os.getenv('SECRET_KEY')
  app.config[&quot;APPINSIGHTS_INSTRUMENTATIONKEY&quot;] = os.getenv('APPINSIGHTS_INSTRUMENTATIONKEY')
  
  appinsights = AppInsights(app)
  app.logger.setLevel(level=logging.INFO)
  logger = app.logger
  
  
  
  @ns.route(&quot;/api/room/parser&quot;)
  class RoomParser(Resource):
      
      @api.expect(swaggerRoom)
      @api.doc(description='Process a JSON object with a room description and a unique identifier in order to run it through the parser. This will result in a list of keywords which will be extracted from the description. The result will be returned in a JSON format')
      def post(self):
          try:
              
              room_desc = &quot;deluxe suite queen ocean view&quot;
              room_id = &quot;ID123&quot;
  
                      
              print('11111111111')
      
                      
  
              if not room_desc or not room_id:
                      return make_json_error_message(&quot;Please send a a room with description and id&quot;,HTTPStatus.BAD_REQUEST)
      
                  room_dict = dict(Room(description=room_desc, id=room_id))
  
                  print(parsed)
  
                  parsed = rtp.parse_title(room_dict)
  
                  print(parsed)
  
                  return jsonify(parsed['room'])
              except Exception as e:
                  logger.error(&quot;Error parsing a room: &quot; + repr(e))
                  return make_json_error_message(&quot;We have encountered an error. Please try again later&quot;,HTTPStatus.BAD_REQUEST)
  
  if __name__ == &quot;__main__&quot;:
      app.run(host=&quot;0.0.0.0&quot;, port=5000)
  </code></pre>
  <p>As you can see I have some print statements and all of them are working on my local consol. But when I track down the code for Example this line,</p>
  <pre><code>parsed = rtp.parse_title(room_dict)
  </code></pre>
  <p>and put some print command inside the parse_title() function which is located in another file, I do NOT see any output in the console as well as webpage!</p>
  <p>Why? I have no idea!!! LOL <em>and that is why I'm here</em>.</p>
  <p>I believe it might be related to the <strong>@ns.route(&quot;/api/room/parser&quot;)</strong> that I have on top of the class, but not sure.</p>
  <p>Can you guys please drop some knowledge here so I can learn and get this code to work on my local completely?</p>
  <p>Thanks for your help!</p>