오 내 로컬 테스트 장고 나는 내 로컬 환경을 이전 SQLLite 데이터베이스에서 Postgres 데이터베이스로 변경하여 heroku를 통해 호스팅되는 실제 환경을 모방하려고 시도하고 있습니다. 이렇게하려면 로컬로 postgres 데이터베이스가 있고 아래와 같이 모든 settings.py를 변경했지만 장고는 DB가 있음을 인식하지 못합니다. 이 외에도 migrate 또는 syncdb를 실행하면 이전 sqllite3 데이터베이스를 다시 생성하려고 시도합니다. 누구나 한 데이터베이스에서 다른 데이터베이스로 변경 한 경험이 있습니까? 비슷한 문제가 있습니까?Django 새로운 데이터베이스 (로컬)로 전환
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'postgres',
# Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'myusername',
'PASSWORD': 'mypassword',
'HOST': 'localhost', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '5432', # Set to empty string for default.
}
}
수정 해 주셔서 감사합니다. 포맷팅을 아직도 배우고 있습니다. – mparrish