Friends,

It seems that it is just not possible to import cartridge.shop.form while 
the apps are still being initialized. I don't know why, but importing 
cartridge.shop.form to app/app/*models.py* does *NOT *work.

But I found a solution to the another question 
<https://groups.google.com/forum/#!topic/mezzanine-users/0Pp4EY3EDgM> that 
brought me to this one. There, Instead of using models.py, I am using 
another file, in this case checkout.py. 
The file checkout.py will be called later, when all the apps are ready. So 
the import works perfectly.

Please read the other post: 
https://groups.google.com/forum/#!topic/mezzanine-users/0Pp4EY3EDgM

To me this question is now closed. 

Thank you very much for all your help, my friends.

Marcio


Em terça-feira, 2 de fevereiro de 2016 18:44:25 UTC-2, Márcio Moreira 
escreveu:
>
> Hello,
>
> I am trying to learn a bit about monkey patching due to a question that I 
> still could not solve 
> <https://groups.google.com/forum/#!topic/mezzanine-users/0Pp4EY3EDgM>. 
> So, I created inside my app the following file ( my_app/my_app/models.py ) 
> with just one line:
>
> from cartridge.shop.forms import OrderForm
>
> And then I got this error:
>
>   File "( ... )/my_app/my_app/models.py", line 6, in <module>
>     from cartridge.shop.forms import OrderForm
> (...)
>   File "( ... )/venv/lib/python3.4/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*.
>
> Just "import cartridge.shop.form" also gives this error. I have tested on 
> two environments with the same result:
>
>    - Ubuntu 14.04.3. Cartridge (0.11.0). Django (1.9.1). Mezzanine 
>    (4.1.0).
>    - Windows 10. Cartridge (0.10.0). Django (1.8.7). Mezzanine (4.0.1).
>    
> Any help is welcome.
>
> Thanks
> Marcio
>
>

-- 
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