from importlib import import_module


def load_app(module_name, objects=None):
    """Simply loads and returns an app module for you.\n
    Params:
    - module_name - module name of your app.
    - objects (str) - if provided, returns a certain part of the module
    instead of the whole thing. Example:
    `load_app('my_app', objects='views')` will return `my_app.views`.
    """
    if objects:
        return import_module(module_name + '.' + objects)
    else:
        return import_module(module_name)