I am trying to switch my django database from sqlite to postgres on my local machine. I am getting the following error when I try to run python manage.py migrate
File "/Users/omarjandali/anaconda3/envs/splittapp/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 24, in <module>
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
Now I did make changes to the settings.py file in order to switch it from the sqlite3 database to the postgres database. My code looks like this.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'splitt',
'USER': 'splittadmin',
'PASSWORD': '*****',
'HOST': 'localhost',
'PORT': '5432',
}
}
This is is what the databse looks like insode of the postgres shell
splitt | splittadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
I was also looking up how to grand all rpivileges of a database to a superuser and I was getting mixed results.