ValueError: Cannot add *: instance is on database “default”, value is on database “None”

The problem here is that you need to call the method save for both objects before adding the template to the product:

template.save()
plan.save()
plan.templates.add(template)

Django can’t add it if none of those objects has an id (plan and template)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)