doniyor
doniyor

Reputation: 37856

django cms_page does not exist - error message when i click on Pages in admin

If I open the admin and click on Pages under cms menu, i am getting this error:

DatabaseError: relation "cms_page" does not exist
LINE 1: SELECT COUNT(*) FROM "cms_page" WHERE ("cms_page"."publisher...

I thought, may be it is because of Site object and created it manuelly.

But i am still getting the same error message, any idea why this is happening?

Upvotes: 0

Views: 731

Answers (2)

Metagrapher
Metagrapher

Reputation: 8912

In my case, migrate itself was failing with this error.
It was an kind of order-of-operations issue with migrate, wherein it was trying to migrate models into a table that did not yet exist. I manually migrated cms using:

python manage.py migrate cms

Then, subsequent runs of python manage.py migrate did not fail on this error.

Upvotes: 1

alko
alko

Reputation: 48317

The error

DatabaseError: relation "cms_page" does not exist

means that "cms_page" relation (PostgreSQL term, meaning table or view) do not exists in your database.

Normally, you create underlying tables for django models with

python manage.py syncdb 

or, if you use South, with

python manage.py migrate

Try running appropriate command, and see if it helps.

Upvotes: 2

Related Questions