Hello,

I am attempting to add a third party application (django-music-publisher) 
into my existing Django Oscar 3.1 applications following the instructions here 
in the django music publisher documentation 
<https://django-music-publisher.readthedocs.io/en/latest/installation.html>.

 

My current Oscar setup works but as soon as I add 
‘music_publisher.apps.MusicPublisherConfig’ 
to my installed apps, I get the error:

 

"django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.” 
Which is preceeded by this stack trace:

 

 

-------------------------BEGINNING OF TRACE ----------------------

Exception in thread django-main-thread:

Traceback (most recent call last):

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\utils.py", line 66, in __getitem__

    return self._engines[alias]

KeyError: 'django'

 

During handling of the above exception, another exception occurred:

 

Traceback (most recent call last):

  File "c:\users\joopa\anaconda3\envs\python38\lib\threading.py", line 932, 
in _bootstrap_inner

    self.run()

  File "c:\users\joopa\anaconda3\envs\python38\lib\threading.py", line 870, 
in run

    self._target(*self._args, **self._kwargs)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper

    fn(*args, **kwargs)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\core\management\commands\runserver.py", 
line 110, in inner_run

    autoreload.raise_last_exception()

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\utils\autoreload.py", line 87, in 
raise_last_exception

    raise _exception[1]

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\core\management\__init__.py", line 375, in 
execute

    autoreload.check_errors(django.setup)()

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper

    fn(*args, **kwargs)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\__init__.py", line 24, in setup

    apps.populate(settings.INSTALLED_APPS)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\apps\registry.py", line 114, in populate

    app_config.import_models()

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\apps\config.py", line 301, in import_models

    self.models_module = import_module(models_module_name)

  File "c:\users\joopa\anaconda3\envs\python38\lib\importlib\__init__.py", 
line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import

  File "<frozen importlib._bootstrap>", line 991, in _find_and_load

  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 848, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in 
_call_with_frames_removed

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\music_publisher\models.py", line 24, in <module>

    from .cwr_templates import (

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\music_publisher\cwr_templates.py", line 13, in 
<module>

    'HDR': Template(

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\base.py", line 148, in __init__

    engine = Engine.get_default()

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\engine.py", line 76, in 
get_default

    for engine in engines.all():

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\utils.py", line 90, in all

    return [self[alias] for alias in self]

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\utils.py", line 90, in <listcomp>

    return [self[alias] for alias in self]

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\utils.py", line 81, in __getitem__

    engine = engine_cls(params)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\backends\django.py", line 25, in 
__init__

    options['libraries'] = self.get_templatetag_libraries(libraries)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\backends\django.py", line 43, in 
get_templatetag_libraries

    libraries = get_installed_libraries()

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\backends\django.py", line 108, in 
get_installed_libraries

    for name in get_package_libraries(pkg):

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\template\backends\django.py", line 121, in 
get_package_libraries

    module = import_module(entry[1])

  File "c:\users\joopa\anaconda3\envs\python38\lib\importlib\__init__.py", 
line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\oscar\templatetags\category_tags.py", line 36, in 
<module>

    class CheapCategoryInfo(dict, 
metaclass=CategoryFieldPassThroughMetaClass):

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\oscar\templatetags\category_tags.py", line 27, in 
__new__

    for field in Category._meta.get_fields():

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\db\models\options.py", line 778, in 
get_fields

    return self._get_fields(include_parents=include_parents, 
include_hidden=include_hidden)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\db\models\options.py", line 838, in 
_get_fields

    all_fields = self._relation_tree

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\utils\functional.py", line 48, in __get__

    res = instance.__dict__[self.name] = self.func(instance)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\db\models\options.py", line 751, in 
_relation_tree

    return self._populate_directed_relation_graph()

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\db\models\options.py", line 721, in 
_populate_directed_relation_graph       

    all_models = self.apps.get_models(include_auto_created=True)

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\apps\registry.py", line 179, in get_models

    self.check_models_ready()

  File "C:\Users\joopa\Projects\Naija Sea - Oscar 
3.1\.nj\lib\site-packages\django\apps\registry.py", line 141, in 
check_models_ready

    raise AppRegistryNotReady("Models aren't loaded yet.")

django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

 

------------------------- END OF TRACE 
-------------------------------------------

 

 

Here is my installed apps:

 -----------------------------

INSTALLED_APPS = [

    'django.contrib.admin',

    'django.contrib.auth',

    'django.contrib.contenttypes',

    'django.contrib.sessions',

    'django.contrib.messages',

    'django.contrib.staticfiles',

 

    'django.contrib.sites',

    'django.contrib.flatpages',

    

 

    'oscar.config.Shop',

 

    *# Overidden Oscar apps*

    'oscarforks.analytics.apps.AnalyticsConfig',

    'oscarforks.checkout.apps.CheckoutConfig',

    'oscarforks.address.apps.AddressConfig',

    'oscarforks.shipping.apps.ShippingConfig',

    'oscarforks.catalogue.apps.CatalogueConfig',

    'oscarforks.communication.apps.CommunicationConfig',

    'oscarforks.partner.apps.PartnerConfig',

    'oscarforks.basket.apps.BasketConfig',

    'oscarforks.payment.apps.PaymentConfig',

    'oscarforks.offer.apps.OfferConfig',

    'oscarforks.order.apps.OrderConfig',

    'oscarforks.customer.apps.CustomerConfig',

    'oscarforks.search.apps.SearchConfig',

    'oscarforks.voucher.apps.VoucherConfig',

    'oscarforks.wishlists.apps.WishlistsConfig',

    

    *#Submodule apps*

    'oscar.apps.catalogue.reviews.apps.CatalogueReviewsConfig', 
*# TODO Find out how to fork submodules*

    

    *# Oscar Dashboard apps*

    'oscar.apps.dashboard.apps.DashboardConfig',

    'oscar.apps.dashboard.reports.apps.ReportsDashboardConfig',

    'oscar.apps.dashboard.users.apps.UsersDashboardConfig',

    'oscar.apps.dashboard.orders.apps.OrdersDashboardConfig',

    'oscar.apps.dashboard.catalogue.apps.CatalogueDashboardConfig',

    'oscar.apps.dashboard.offers.apps.OffersDashboardConfig',

    'oscar.apps.dashboard.partners.apps.PartnersDashboardConfig',

    'oscar.apps.dashboard.pages.apps.PagesDashboardConfig',

    'oscar.apps.dashboard.ranges.apps.RangesDashboardConfig',

    'oscar.apps.dashboard.reviews.apps.ReviewsDashboardConfig',

    'oscar.apps.dashboard.vouchers.apps.VouchersDashboardConfig',

    'oscar.apps.dashboard.communications.apps.CommunicationsDashboardConfig'
,

    'oscar.apps.dashboard.shipping.apps.ShippingDashboardConfig',

    

    *# 3rd-party apps that oscar depends on*

    'widget_tweaks',

    'haystack',

    'treebeard',

    'sorl.thumbnail',   *# Default thumbnail backend, can be replaced*

    'django_tables2',


    *# MyAppsapps*

    'apps.creators.apps.CreatorsConfig',

    *'music_publisher.apps.MusicPublisherConfig',*

]

 ---------------------

 

I have tried the suggestions on this thread:
Stackoverflow thread on a similar error with Models not loaded 
<https://stackoverflow.com/questions/25244631/models-arent-loaded-yet-error-while-populating-in-django-1-8-or-later/25244833#25244833>
 
as well as other similar threads.

Here is my wsgi.py file:

 ---------------

import os

from django.core.wsgi import get_wsgi_application

 

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')

 

application = get_wsgi_application()

 -------------

I have no idea why it wont work... 
Please let me know if you need more information on my end. 

 

Many thanks in advance.

 

Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

 

-- 
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
--- 
You received this message because you are subscribed to the Google Groups 
"django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-oscar+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-oscar/13600d46-6725-4176-bd71-7ba0fcc96a49n%40googlegroups.com.

Reply via email to