Integrityerror Insert Or Update On Table "orders_order" Violates Foreign Key Constraint "
I am trying to build an ecommerce site in Django 1.7 everything works except when I try to use the checkout, I got the following error. I am not sure wht it is doing this as it wo
Solution 1:
The important detail is in this line:
DETAIL:Key (billing_address_id)=(1) isnot present in table "accounts_useraddress".
The problem is that you are trying to link an order with a billing address which is not yet present in the database.
In your code you'll need to make sure that the billing address is saved to the database before you try and save an object that is related to it by foreign key.
Post a Comment for "Integrityerror Insert Or Update On Table "orders_order" Violates Foreign Key Constraint ""