def METHOD_NAME():
    with backup_lock():
        # Expand settings in case it contains non-trivial code
        command = diffsettings.Command()
        kwargs = {"default": None, "all": False, "output": "hash"}
        with open(data_dir("backups", "settings-expanded.py"), "w") as handle:
            handle.write(command.handle(**kwargs))
        # Backup original settings
        if settings.SETTINGS_MODULE:
            settings_mod = import_module(settings.SETTINGS_MODULE)
            copyfile(settings_mod.__file__, data_dir("backups", "settings.py"))
        # Backup environment (to make restoring Docker easier)
        with open(data_dir("backups", "environment.yml"), "w") as handle:
            yaml = YAML()
            yaml.dump(dict(os.environ), handle)