Hi,

Why is this exception happening all the time whenever I try to import the Site model

from livesettings? I managed to run manage.py migrate --run-syncdb to create the sql

tables. I do use django.setup() in my script (wsgiserver) but it doesn't seem to play nicely with livesettings.

Is it possible to delay livesettings imports until the app registry is loaded ?

Regards,

Etienne


Environment:


Request Method: GET
Request URL: http://localhost:8000/

Django Version: 1.10
Python Version: 2.7.9
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sites',
 'django.contrib.sessions',
 'django.contrib.sitemaps',
 'satchmo_store.shop',
 'satchmo_store',
 'sorl.thumbnail',
 'keyedcache',
 'livesettings',
 'l10n',
 'satchmo_store.contact',
 'tax',
 'tax.modules.no',
 'tax.modules.area',
 'tax.modules.percent',
 'shipping',
 'product',
 'payment',
 'payment.modules.dummy',
 'satchmo_ext.satchmo_toolbar',
 'satchmo_utils')
Installed Middleware:
['django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware']



Traceback:

File "/home/erob/ncvs/django/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/home/erob/ncvs/django/django/core/handlers/base.py" in _get_response
  172.         resolver_match = resolver.resolve(request.path_info)

File "/home/erob/ncvs/django/django/urls/resolvers.py" in resolve
  267.             for pattern in self.url_patterns:

File "/home/erob/ncvs/django/django/utils/functional.py" in __get__
  35.         res = instance.__dict__[self.name] = self.func(instance)

File "/home/erob/ncvs/django/django/urls/resolvers.py" in url_patterns
310. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

File "/home/erob/ncvs/django/django/utils/functional.py" in __get__
  35.         res = instance.__dict__[self.name] = self.func(instance)

File "/home/erob/ncvs/django/django/urls/resolvers.py" in urlconf_module
  303.             return import_module(self.urlconf_name)

File "/usr/lib/python2.7/importlib/__init__.py" in import_module
  37.     __import__(name)

File "/home/erob/src/django-hotsauce-devel/examples/lib/satchmo_store/urls/default.py" in <module>
  12. urlpatterns.include('satchmo_store.shop.urls', prefix='^shop/')

File "/home/erob/src/django-hotsauce-devel/lib/notmm/utils/urlmap.py" in include
  122.             urlconf = import_module(urlobj)

File "/usr/lib/python2.7/importlib/__init__.py" in import_module
  37.     __import__(name)

File "/home/erob/src/django-hotsauce-devel/examples/lib/satchmo_store/shop/urls.py" in <module>
  27.     url(r'^search/$', 'search.search_view', {}, 'satchmo_search'),

File "/home/erob/src/django-hotsauce-devel/lib/notmm/utils/urlmap.py" in add_routes 80. view_mod = get_callable(self.callback_prefix + '.' + t.callback)

File "/home/erob/ncvs/django/django/utils/lru_cache.py" in wrapper
  100.                     result = user_function(*args, **kwds)

File "/home/erob/ncvs/django/django/urls/utils.py" in get_callable
  30.         mod = import_module(mod_name)

File "/usr/lib/python2.7/importlib/__init__.py" in import_module
  37.     __import__(name)

File "/home/erob/src/django-hotsauce-devel/examples/lib/satchmo_store/shop/views/home.py" in <module>
  5. from product.views import display_featured

File "/home/erob/src/django-hotsauce-devel/examples/lib/product/views/__init__.py" in <module>
  9. from livesettings.functions import config_value

File "/home/erob/src/django-hotsauce-devel/examples/lib/site-packages/livesettings/functions.py" in <module>
  3. from livesettings import values

File "/home/erob/src/django-hotsauce-devel/examples/lib/site-packages/livesettings/values.py" in <module> 16. from livesettings.models import find_setting, LongSetting, Setting, SettingNotSet

File "/home/erob/src/django-hotsauce-devel/examples/lib/site-packages/livesettings/models.py" in <module>
  2. from django.contrib.sites.models import Site

File "/home/erob/ncvs/django/django/contrib/sites/models.py" in <module>
  86. class Site(models.Model):

File "/home/erob/ncvs/django/django/db/models/base.py" in __new__
  105.         app_config = apps.get_containing_app_config(module)

File "/home/erob/ncvs/django/django/apps/registry.py" in get_containing_app_config
  237.         self.check_apps_ready()

File "/home/erob/ncvs/django/django/apps/registry.py" in check_apps_ready
  124.             raise AppRegistryNotReady("Apps aren't loaded yet.")

Exception Type: AppRegistryNotReady at /
Exception Value: Apps aren't loaded yet.

--
You received this message because you are subscribed to the Google Groups "Satchmo 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/satchmo-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to