Skip to content
This repository was archived by the owner on Mar 5, 2021. It is now read-only.
This repository was archived by the owner on Mar 5, 2021. It is now read-only.

Reopening issue #39: IntegrityError while importing example database (postgres) #122

Description

@fp4code

I reopen the issue #39. Loading example_database.json seems not possible if using postgres.

  1. Postgresql, with no database:
    $ dropdb base_django01
    $ python manage.py syncdb --noinput --all
    ...
    psycopg2.OperationalError: FATAL: database "base_django01" does not exist

  2. Postgresql, with fresh database:
    $ createdb -T template0 base_django01
    $ python manage.py syncdb --noinput --all
    $ python manage.py loaddata example_database.json
    .../python2.7/site-packages/cms/utils/plugins.py:125: DuplicatePlaceholderWarning: Duplicate placeholder found: body
    warnings.warn("Duplicate placeholder found: %s" % placeholder, DuplicatePlaceholderWarning)
    ...
    IntegrityError: Could not load cms.Page(pk=1): duplicate key value violates unique constraint "cms_placeholder_pkey"
    DETAIL: Key (id)=(1) already exists.

trying a second loaddata, I get
DETAIL: Key (id)=(2) already exists.

  1. Sqlite
    $ python manage.py loaddata example_database.json
    .../python2.7/site-packages/cms/utils/plugins.py:125: DuplicatePlaceholderWarning: Duplicate placeholder found: body
    warnings.warn("Duplicate placeholder found: %s" % placeholder, DuplicatePlaceholderWarning)
    Installed 1039 object(s) from 1 fixture(s)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions