Commits

sixstone committed cadf505

Remove autodiscover from init and do this in main app urls file

Comments (0)

Files changed (2)

dbgettext/__init__.py

 # based on django.contrib.admin.__init__.py
 
-from django.utils.importlib import import_module
 LOADING = False
 
 from django.conf import settings
         return
     LOADING = True
 
+    from django.utils.importlib import import_module
     import imp
     for app in settings.INSTALLED_APPS:
         try:
 
     LOADING = False
 
-# go:
-autodiscover()
+

docs/registration.rst

 	
     registry.register(MyModel, MyModelOptions)
 
+And add autodiscover method in your main application ``urls.py``
+file. For example::
+
+    import dbgettext
+    dbgettext.autodiscover()
+
 That's it. Your ``dbgettext_registration.py`` files will be automatically imported by django-dbgettext, and registered models will be included when running :doc:`dbgettext_export <dbgettext_export>`.
 
 You can customise the module name using the ``DBGETTEXT_REGISTRATION_MODULE_NAME`` :ref:`setting <settings>`.