0

I installed django and installed the pydev plugin under eclipse. Then I downloaded the postgres(1.16.0) sql tool and installed that. Here are my settings:

enter image description here

Then I wanted to configure the setting file under django:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2' , 
        'NAME': 'django',                   
        'USER': 'postgres',                 
        'PASSWORD': 'admin',                
        'HOST': '',        
        'PORT': '',                     
    }
}

but when I do syncdb i get:

    backend = load_backend(db['ENGINE'])
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 24, in load_backend
    return import_module('.base', backend_name)
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
    __import__(name)
  File "C:\Python27\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 13, in <module>
    from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
  File "C:\Python27\lib\site-packages\django\db\backends\postgresql_psycopg2\creation.py", line 1, in <module>
    import psycopg2.extensions
ImportError: No module named psycopg2.extensions

What do I do wrong?

PS.: I am developing under win7 and eclipse juno

1 Answer 1

1

Install psycopg2

pip install psycopg2

Psycopg is the most popular PostgreSQL adapter for the Python programming language. At its core it fully implements the Python DB API 2.0 specifications.

Sign up to request clarification or add additional context in comments.

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.