# Path: apis/exception.py
# class Unauthorized(MetisException):
#     pass
# 
# class NotFound(MetisException):
#     pass
# 
# class BadRequest(MetisException):
#     pass
# 
# class Forbidden(MetisException):
#     pass
# 
# class RequestTimeout(MetisException):
#     pass
# 
# class ServerError(MetisException):
#     pass
# 
# Path: apis/custom_errors.py
# class UnprocessableEntity(JSONException):
#     pass
# 
# class ServerError(JSONException):
#     pass
# 
# class Forbidden(JSONException):
#     pass
# 
# Path: apis/settings.py
# class Config(LConfig):
#     pass


from sanic import Sanic
from sanic.response import json
from sanic.exceptions import NotFound as _NotFound, InvalidUsage
from apis.exception import (Unauthorized, NotFound, BadRequest,
                            Forbidden, RequestTimeout, ServerError)
from apis.custom_errors import (UnprocessableEntity,
                                ServerError as _ServerError,
                                Forbidden as _Forbidden)
from apis.settings import Config
    from apis.auth import bp as auth_bp
    from apis.v1 import bp as v1_bp
# -*- coding: utf-8 -*-





def create_app(register_bp=True, test=False):
    app = Sanic(__name__)
    if test:
        app.config['TESTING'] = True
    app.config.from_object(Config)
    app.static('/static/', './apis/static')
    if register_bp:

# Path: apis/exception.py
# class Unauthorized(MetisException):
#     pass
# 
# class NotFound(MetisException):
#     pass
# 
# class BadRequest(MetisException):
#     pass
# 
# class Forbidden(MetisException):
#     pass
# 
# class RequestTimeout(MetisException):
#     pass
# 
# class ServerError(MetisException):
#     pass
# 
# Path: apis/custom_errors.py
# class UnprocessableEntity(JSONException):
#     pass
# 
# class ServerError(JSONException):
#     pass
# 
# class Forbidden(JSONException):
#     pass
# 
# Path: apis/settings.py
# class Config(LConfig):
#     pass


# Path: apis/app.py
from sanic import Sanic
from sanic.response import json
from sanic.exceptions import NotFound as _NotFound, InvalidUsage
from apis.exception import (Unauthorized, NotFound, BadRequest,
                            Forbidden, RequestTimeout, ServerError)
from apis.custom_errors import (UnprocessableEntity,
                                ServerError as _ServerError,
                                Forbidden as _Forbidden)
from apis.settings import Config
    from apis.auth import bp as auth_bp
    from apis.v1 import bp as v1_bp

# -*- coding: utf-8 -*-





def create_app(register_bp=True, test=False):
    app = Sanic(__name__)
    if test:
        app.config['TESTING'] = True
    app.config.from_object(Config)
    app.static('/static/', './apis/static')
    if register_bp:

       register_blueprints(app)