Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top