1

Here is what I am trying to do

  1. python manage.py dumpdata > database.json
  2. Changing my setting files: from

    DATABASES = {
    
        'default': {
    
            'ENGINE': 'django.db.backends.sqlite3',
    
            'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    
        }
    
    }
    

    to

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'mydatabase',
            'USER': 'myusername',
            'PASSWORD': 'mypassword',
            'HOST': '127.0.0.1',
            'PORT': '5432',
        }
    }
    

    Now I m getting an error that

Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?

I have following doubts

  1. Do I need to create a new database('mydatabase') for postgres. If so please point out how can I do so?
  2. Do I need to create a new superuser for postgres? I have been using the same user and password that I created for sqllite3.
  3. What follows when above error is fixed.
TimoStaudinger
  • 41,396
  • 16
  • 88
  • 94

0 Answers0