4

I am trying to hook my website up to use postgresql. I installed postgresql and psycopg2. In settings.py, I placed the following, and then got the error shown afterwards. I should mention that I tested the site with mysql before attempting to migrate to postresql.

from Settings.py:

DATABASES = {

'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'pdbt', 
    'USER': '',
    'PASSWORD': '',
    'HOST': 'localhost',
    'PORT': '', 
}
}

error:

DatabaseError at /viewer/

relation "django_session" does not exist

LINE 1: ...ession_data", "django_session"."expire_date" FROM "django_se...
1
  • 2
    did you run ./manage.py syncdb ? Commented Jun 21, 2013 at 14:54

3 Answers 3

2

And if anyone is using newer versions of django, they should run this command:

//for newer versions
python manage.py migrate 

//for old versions
python manage.py syncdb
Sign up to request clarification or add additional context in comments.

Comments

1

Ok I figured it out - I had to run syncdb! Yikes. Also, I see that karthikr pointed out the same thing. Thanks!

Comments

1

If you see the above error message, it means you haven't created the tables yet. To create the tables, just do the following:

  1. Switch to the directory that you have 'manage.py'
  2. Then do 'python manage.py syncdb' and you'll see the following: enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.