def get_app_name(cls):
    """Return the app_name associated with the given ViewPack class."""
    app_name = getattr(cls, 'app_name', None)
    if app_name is not None:
        return app_name
    return cls.__module__.partition('.')[0]
