Menu

#570 Django 1.9 and relation "django_facebook_open_graph_share" does not exist

open
nobody
None
2018-04-23
2016-04-09
Anonymous
No

Originally created by: turukawa

I've been upgrading a Django project to 1.9 and get the following error with Django Facebook:

ProgrammingError at /admin/django_facebook/opengraphshare/
relation "django_facebook_open_graph_share" does not exist
LINE 1: SELECT COUNT(*) AS "__count" FROM "django_facebook_open_grap...

I've installed the Django Facebook 6.0.4 version from Master which is mostly Django 1.9 compliant (and I fixed the urlpatterns in urls.py for my version).

On my build the error is simple enough to reproduce. Go into the admin view and select Open graph shares. Instant chaos.

I've seen the discussion for https://github.com/tschellenbach/Django-facebook/issues/523 by @amarpreetsaini but there doesn't seem to be any resolution to that, and I'm not sure if this is new and related to 1.9.

I'm less interested in the OpenGraphShare problem than that this prevents me deleting users (results in the same error message).

Any ideas?

Related

Tickets: #577

Discussion

  • Anonymous

    Anonymous - 2016-04-09

    Originally posted by: turukawa

    UPDATE: this seems a very terrible and stupid hack, but - after the database has been created - if I directly edit the table name from 'django_facebook_opengraphshare' to 'django_facebook_open_graph_share' it works.

    I don't feel comfortable doing this, so would prefer a more lasting solution. Any thoughts?

     
  • Anonymous

    Anonymous - 2016-09-12

    Originally posted by: jsvaughan

    As a workaround note that:

    • You can tell django-facebook explicitly what this table is called with this setting:
      FACEBOOK_OG_SHARE_DB_TABLE= 'django_facebook_open_graph_share'
    • But you will still get this problem when, for example, running tests, because django attempts to serialize the database contents so it can do a pseudo rollback even if you aren't using transactions (I know - this was news to me too). Given that you are bound to be using transactions, you can set the SERIALIZE django parameter to False (see https://docs.djangoproject.com/en/1.10/ref/settings/#std:setting-TEST_SERIALIZE) and this will stop it trying to query the table contents prior to running the tests. e.g.

    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.mysql',
    ...
    'TEST': {
    'SERIALIZE': False,
    }
    },

    I'm part way through a django upgrade so YMMV but I am at least able now to run my test suite

     
  • Anonymous

    Anonymous - 2018-04-23

    Originally posted by: Jiloc

    still no fixes? I am running in to this right now

     

Log in to post a comment.

MongoDB Logo MongoDB