0

after applying all migration using heroku run python manage.py migrate. it gives this error. I had switched to postgresql. But migration are still applied only on sqlite3.

OperationalError at /
no such table: shastri_occasion
Request Method: GET
Request URL:    https://bdsharma.herokuapp.com/
Django Version: 3.1.1
Exception Type: OperationalError
Exception Value:    
no such table: shastri_occasion
Exception Location: /app/.heroku/python/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py, line 413, in execute
Python Executable:  /app/.heroku/python/bin/python
Python Version: 3.6.12
Python Path:    
['/app/.heroku/python/bin',
 '/app',
 '/app/.heroku/python/lib/python36.zip',
 '/app/.heroku/python/lib/python3.6',
 '/app/.heroku/python/lib/python3.6/lib-dynload',
 '/app/.heroku/python/lib/python3.6/site-packages']
Server time:    Fri, 11 Sep 2020 09:34:29 +0000

I had switched to postgresql. But migration are still applied only on sqlite3. This is my setting.py database setting:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'ddbp7me1o4bf',
        'USER' :'iwdvmaevgph',
        'PASSWORD' : '****************************8',
        'HOST' : '*****************8',
        'PORT' : '5432',

    }
}

1 Answer 1

1

You can configure the database setting like this.

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'project',
        'USER': 'root',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '',
    }
}
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.