<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_apps(self, only=None):
 """Returns a list of names of available Django applications, Optionally filters it using `only`. :param list|None only: a list on apps names to to filter all available apps against :raises: DjangoDevException on errors :rtype: list :return: list of apps names """

        if not os.path.exists(self.apps_path):
            error_str = 'It seems that this directory does not contain django-dev project. ' \
                        'Use `bootstrap` command to create project in the current directory.'
            self.logger.error(error_str)
            raise DjangoDevException(error_str)

        apps = os.listdir(self.apps_path)

        if not apps:
            error_str = 'Applications directory is empty. ' \
                        'Please symlink your apps (and other apps that you apps depend upon) into %s' % self.apps_path
            self.logger.error(error_str)
            raise DjangoDevException(error_str)

        apps.sort()
        if only is None:
            self.create_manage_py(apps)
            return apps

        diff = set(only).difference(apps)
        if diff:
            error_str = 'The following apps are not found: `%s`.' % ('`, `'.join(diff))
            self.logger.error(error_str)
            raise DjangoDevException(error_str)

        self.create_manage_py(apps)

        return [name for name in apps if name in only]