def get_settings_from_profile(profile, profile_dir=None):<EOL>
if profile_dir is None:<EOL><INDENT>import settings<EOL>profile_dir = settings<EOL><DEDENT>if hasattr(profile_dir, '<STR_LIT>'):<EOL><INDENT>profile_dir = os.path.dirname(profile_dir.__file__)<EOL><DEDENT>return os.path.join(profile_dir, '<STR_LIT>'.format(profile))<EOL>
Returns the  configuration file path for the given profile.

    :param profile: Profile name to be used.
    :param profile_dir: The directory where the profile configuration file should reside. It
                        may be also a module, and then the directory of the module is used.
    :return: Configuration file path.