Fixed here:
https://github.com/stephenmcd/cartridge/commit/c6aa87003d41ee203f5070f6601c81b844047e94

On Mon, Jul 13, 2015 at 2:56 PM, Stephen McDonald <[email protected]> wrote:

> I can confirm this bug - the demo site doesn't hit it as it defines
> the SHOP_CURRENCY_LOCALE setting in its settings module.
>
> On Sat, Jul 11, 2015 at 11:49 AM, Danny <[email protected]> wrote:
>
>> Hi all,
>>
>> I was wondering if anyone could help me!
>>
>> I've tried the new Mezzanine 4.0 release with cartridge master (which
>> Stephen said should work) and am getting AppRegistryNotReady exception from
>> shop.models.Priced():
>>
>> BACKTRACE:
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:51:
>> UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
>> requires. Will fall back to the domains configured as sites.
>>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
>> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/generic/fields.py:6:
>> RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated
>> and will be removed in Django 1.9. Its contents have been moved to the
>> fields, forms, and admin submodules of django.contrib.contenttypes.
>>   from django.contrib.contenttypes.generic import GenericRelation
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 14, in <module>
>>     execute_from_command_line(sys.argv)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 338, in execute_from_command_line
>>     utility.execute()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 312, in execute
>>     django.setup()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/__init__.py",
>> line 18, in setup
>>     apps.populate(settings.INSTALLED_APPS)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/registry.py",
>> line 108, in populate
>>     app_config.import_models(all_models)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/config.py",
>> line 198, in import_models
>>     self.models_module = import_module(models_module_name)
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
>> import_module
>>     __import__(name)
>>   File
>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
>> line 35, in <module>
>>     class Priced(models.Model):
>>   File
>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
>> line 41, in Priced
>>     unit_price = fields.MoneyField(_("Unit price"))
>>   File
>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/fields.py",
>> line 46, in __init__
>>     set_locale()
>>   File
>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/utils.py", line
>> 103, in set_locale
>>     currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>> line 236, in __getattr__
>>     editable_cache = self._get_editable(request=self._current_request)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>> line 152, in _get_editable
>>     editable_settings = self._editable_caches[request] = self._load()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>> line 191, in _load
>>     for setting_obj in Setting.objects.all():
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/manager.py",
>> line 228, in all
>>     return self.get_queryset()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/core/managers.py",
>> line 349, in get_queryset
>>     return super(DjangoCSM, self).get_queryset().filter(**lookup)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py",
>> line 679, in filter
>>     return self._filter_or_exclude(False, *args, **kwargs)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py",
>> line 697, in _filter_or_exclude
>>     clone.query.add_q(Q(*args, **kwargs))
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>> line 1309, in add_q
>>     clause, require_inner = self._add_q(where_part, self.used_aliases)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>> line 1337, in _add_q
>>     allow_joins=allow_joins, split_subq=split_subq,
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>> line 1149, in build_filter
>>     lookups, parts, reffed_expression = self.solve_lookup_type(arg)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>> line 1035, in solve_lookup_type
>>     _, field, _, lookup_parts = self.names_to_path(lookup_splitted,
>> self.get_meta())
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>> line 1372, in names_to_path
>>     if field.is_relation and not field.related_model:
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/utils/functional.py",
>> line 60, in __get__
>>     res = instance.__dict__[self.name] = self.func(instance)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/fields/related.py",
>> line 110, in related_model
>>     apps.check_models_ready()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/registry.py",
>> line 131, in check_models_ready
>>     raise AppRegistryNotReady("Models aren't loaded yet.")
>> django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> What I did to set up:
>>
>> mkvirtualenv mez4
>> pip install mezzanine
>> pip install -e git+
>> https://github.com/stephenmcd/cartridge.git@master#egg=cartridge
>> mezzanine-project mez4  (NB not with cartridge template, as it hasn't
>> been updated yet)
>>
>> Edits to mez4/settings.py:
>>
>> INSTALLED_APPS = {
>>    ...
>>    "django.contrib.staticfiles",
>>    "cartridge.shop",
>>    "mezzanine.boot",
>>    ...
>> }
>>
>> MIDDLEWARE_CLASSES = {
>>    ...
>>    "django.middleware.clickjacking.XFrameOptionsMiddleware",
>>    "cartridge.shop.middleware.ShopMiddleware",
>>    "mezzanine.core.request.CurrentRequestMiddleware",
>>    ...
>> }
>>
>> And finally:
>> python manage.py createdb
>>
>> which gives the above backtrace. (in fact, any manage.py command gives
>> the same backtrace).
>>
>> Thanks for any help...
>>
>> Seeya. Danny.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Stephen McDonald
> http://jupo.org
>



-- 
Stephen McDonald
http://jupo.org

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

Reply via email to