I'm trying to integrate django-shop with a simple django installation but it gives my following error :
django.core.exceptions.ImproperlyConfigured: Deferred foreign key 'OrderPayment.order' has not been mapped
I even tried creating the OrderPayment model as referred in docs as below but still I got no luck.
class OrderPayment(models.Model):
id = models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')
order = models.ForeignKey(on_delete=models.deletion.CASCADE, to=Order, verbose_name='Order')
class Meta():
verbose_name = "Order Payment"
You either have to implement your materialized models first or to import the defaults models in your shop implementation. See this link: http://django-shop.readthedocs.io/en/latest/reference/deferred-models.html
Edit: The defaults models are located in the shop/models/defaults directory. You can either import them in your shop implementation or copy them and modify them to fit your project needs.
shop/models/defaults/__init__.py says: