from flask import Flask
from flask.ext.bootstrap import Bootstrap
from config import config


bootstrap = Bootstrap()


def create_app(config_name):

    application = Flask(__name__)
    application.config['DEBUG'] = True
    application.config.from_object(config[config_name])
    config[config_name].init_app(application)

    bootstrap.init_app(application)

    from .main import main as main_blueprint
    application.register_blueprint(main_blueprint)
    main_blueprint.config = {
        'BASE_TEMPLATE_DATA': application.config['BASE_TEMPLATE_DATA']
    }

    return application

from flask import Flask
from flask.ext.bootstrap import Bootstrap
from config import config

from .main import main as main_blueprint


def create_app(config_name):

    application = Flask(__name__,
                        static_folder='static/',
                        static_url_path=config[config_name].STATIC_URL_PATH)

    application.config.from_object(config[config_name])
    config[config_name].init_app(application)

    bootstrap = Bootstrap()
    bootstrap.init_app(application)

    application.register_blueprint(main_blueprint,
                                   url_prefix='/supplier')
    main_blueprint.config = {
        'BASE_TEMPLATE_DATA': application.config['BASE_TEMPLATE_DATA']
    }

    return application

Add /supplier prefix to main blueprint and static URLs
Add /supplier prefix to main blueprint and static URLs

  from flask import Flask
  from flask.ext.bootstrap import Bootstrap
  from config import config
  
+ from .main import main as main_blueprint
- 
- bootstrap = Bootstrap()
  
  
  def create_app(config_name):
  
-     application = Flask(__name__)
+     application = Flask(__name__,
-     application.config['DEBUG'] = True
+                         static_folder='static/',
+                         static_url_path=config[config_name].STATIC_URL_PATH)
+ 
      application.config.from_object(config[config_name])
      config[config_name].init_app(application)
  
+     bootstrap = Bootstrap()
      bootstrap.init_app(application)
  
-     from .main import main as main_blueprint
-     application.register_blueprint(main_blueprint)
+     application.register_blueprint(main_blueprint,
+                                    url_prefix='/supplier')
      main_blueprint.config = {
          'BASE_TEMPLATE_DATA': application.config['BASE_TEMPLATE_DATA']
      }
  
      return application
  
Add /supplier prefix to main blueprint and static URLs
## Code Before:
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from config import config


bootstrap = Bootstrap()


def create_app(config_name):

    application = Flask(__name__)
    application.config['DEBUG'] = True
    application.config.from_object(config[config_name])
    config[config_name].init_app(application)

    bootstrap.init_app(application)

    from .main import main as main_blueprint
    application.register_blueprint(main_blueprint)
    main_blueprint.config = {
        'BASE_TEMPLATE_DATA': application.config['BASE_TEMPLATE_DATA']
    }

    return application

## Instruction:
Add /supplier prefix to main blueprint and static URLs
## Code After:
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from config import config

from .main import main as main_blueprint


def create_app(config_name):

    application = Flask(__name__,
                        static_folder='static/',
                        static_url_path=config[config_name].STATIC_URL_PATH)

    application.config.from_object(config[config_name])
    config[config_name].init_app(application)

    bootstrap = Bootstrap()
    bootstrap.init_app(application)

    application.register_blueprint(main_blueprint,
                                   url_prefix='/supplier')
    main_blueprint.config = {
        'BASE_TEMPLATE_DATA': application.config['BASE_TEMPLATE_DATA']
    }

    return application
