File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ def autodiscover():
1717 from importlib import import_module
1818 from django .conf import settings
1919 from django .utils .module_loading import module_has_submodule
20+ from django .apps import apps
21+
2022 setattr (settings , 'CRISPY_TEMPLATE_PACK' , 'bootstrap3' )
2123 setattr (settings , 'CRISPY_CLASS_CONVERTERS' , {
2224 "textinput" : "textinput textInput form-control" ,
@@ -46,12 +48,12 @@ def autodiscover():
4648 from xadmin .plugins import register_builtin_plugins
4749 register_builtin_plugins (site )
4850
49- for app in settings . INSTALLED_APPS :
50- mod = import_module (app )
51+ for app_config in apps . get_app_configs () :
52+ mod = import_module (app_config . name )
5153 # Attempt to import the app's admin module.
5254 try :
5355 before_import_registry = site .copy_registry ()
54- import_module ('%s.adminx' % app )
56+ import_module ('%s.adminx' % app_config . name )
5557 except :
5658 # Reset the model registry to the state before the last import as
5759 # this import will have to reoccur on the next request and this
You can’t perform that action at this time.
0 commit comments