Hi, I've completed a handful of Django tutorials (including the official Django one, the Mozilla one, and several Udemy courses), and I have a pretty good understanding of how Django works. Yet every time I try to use PostgreSQL instead of SQLite (using [this tutorial](https://www.enterprisedb.com/postgres-tutorials/how-use-postgresql-django)) and try to set up custom user admin (using [this tutorial](https://wsvincent.com/django-allauth-tutorial-custom-user-model/)), I constantly get migration errors.
Can anyone recommend better tutorials for understanding how to use PostgreSQL? (Even just understanding that I have to use psycopg2-binary instead of psycopg2 took days since it's not mentioned in any of the tutorials I found online.) Thanks in advance!
Pretty printed has a video about integrating postgres, but i don’t know why are you running into problems, in my experience it was just installing postgres, creating a db and changing settings. How are you setting up the whole thing?
In your settings.py
import psycopg2.extensions
DATABASES = {,‘,‘,‘,‘,
‘default’: {
‘ENGINE’: ‘django.db.backends.postgresql’,
‘PASSWORD’:
‘NAME’: ‘
‘USER’: ‘
‘HOST’: ‘
‘PORT’:
}
}
Clear your \_\_pycache\_\_ files, just to be sure.
Then try to migrate again.
Digital Ocean has a good PostgreSQL tutorial, in fact that have a lot of good tutorials
I recommend when using PostgreSQL that you use a .env to store the database info, and use
[https://pypi.org/project/dj-database-url/](https://pypi.org/project/dj-database-url/)
And
[https://pypi.org/project/python-dotenv/](https://pypi.org/project/python-dotenv/)
You can try going through this if your on a ubuntu based os: https://djangocentral.com/using-postgresql-with-django/
I used it to set up my postgresql if you get trouble installing postgresql install the binary version and you should be alright.
Also if your’e getting migration errors it might be due to your migrations copy them and place them in another folder then delete the ones in your migratjon folder I find it’s normally a migration file that causes the problem to me