django-synchro
django-synchro copied to clipboard
Router settings
I wanted just to test the library to use my app as a database repository so I set it up very basically:
- installed library via github
- configured DATABASES
- added synchro to INSTALLED_APPS
- added SYNCHRO_REMOTE and SYNCHRO_MODELS to app settings
Then I deployed an app on heroku cloud and copied my database from app. Then I changed few things locally. After that I tried to synchronize it via localhost:8000/synchro
and via python manage.py synchronize
The outcome is quite strange: for the browser synchro I always get the following error:
An error occured: Cannot assign "<Object name>": the current database router prevents this relation. (ValueError)
for shell command I always get the No changes since last synchronization.
communicate
:cry:
I hope that you also installed and added dbsettings
to INSTALLED_APPS
.
Leaving this aside, it seems your configuration is correct.
So debugging arise:
- Can you post your settings somewhere?
- Did you run
synchronize
command locally? - When you modify local objects, does something change in
synchro_changelog
table at all? - Is your local database named
'default'
?
It's very strange that the same error does not show in both places. The error generally means that some object has foreign relation and its relation is not being saved to the same database. Can you add __unicode__
methods to your models to show something more beside "<Object name>"
(in order to track which model is causing troubles) and ensure that all related models are also listed in SYNCHRO_MODELS
?