Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router settings #15

Open
ppeczek opened this issue Nov 27, 2017 · 1 comment
Open

Router settings #15

ppeczek opened this issue Nov 27, 2017 · 1 comment

Comments

@ppeczek
Copy link

ppeczek commented Nov 27, 2017

I wanted just to test the library to use my app as a database repository so I set it up very basically:

  1. installed library via github
  2. configured DATABASES
  3. added synchro to INSTALLED_APPS
  4. 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
😢

@zlorf
Copy link
Owner

zlorf commented Nov 27, 2017

I hope that you also installed and added dbsettings to INSTALLED_APPS.
Leaving this aside, it seems your configuration is correct.
So debugging arise:

  1. Can you post your settings somewhere?
  2. Did you run synchronize command locally?
  3. When you modify local objects, does something change in synchro_changelog table at all?
  4. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants