MCPcopy
hub / github.com/django/django / get_app_config

Method get_app_config

django/apps/registry.py:150–165  ·  view source on GitHub ↗

Import applications and returns an app config for the given label. Raise LookupError if no application exists with this label.

(self, app_label)

Source from the content-addressed store, hash-verified

148 return self.app_configs.values()
149
150 def get_app_config(self, app_label):
151 """
152 Import applications and returns an app config for the given label.
153
154 Raise LookupError if no application exists with this label.
155 """
156 self.check_apps_ready()
157 try:
158 return self.app_configs[app_label]
159 except KeyError:
160 message = "No installed app with label '%s'." % app_label
161 for app_config in self.get_app_configs():
162 if app_config.name == app_label:
163 message += " Did you mean '%s'?" % app_config.label
164 break
165 raise LookupError(message)
166
167 # This method is performance-critical at least for Django's test suite.
168 @functools.cache

Callers 15

get_modelMethod · 0.95
set_optionsMethod · 0.80
create_permissionsFunction · 0.80
create_contenttypesFunction · 0.80
get_context_dataMethod · 0.80
_build_app_dictMethod · 0.80
_setupMethod · 0.80
app_model_errorFunction · 0.80
handleMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80

Calls 2

check_apps_readyMethod · 0.95
get_app_configsMethod · 0.95

Tested by 15

setUpMethod · 0.64
test_no_modelsMethod · 0.64
test_egg1Method · 0.64
test_egg2Method · 0.64
test_egg3Method · 0.64
test_egg4Method · 0.64
test_no_config_appMethod · 0.64
test_one_config_appMethod · 0.64
test_two_configs_appMethod · 0.64
test_get_app_configMethod · 0.64