Skip to content Skip to sidebar Skip to footer

Programmingerror: Relation "django_session" Does Not Exist

Got this error after changing my database from sqlite to postgresql. I've made all my settings changes: Here's my settings: DATABASES = { 'default': { 'ENGINE': 'djang

Solution 1:

Try fake migrate to zero.

Your migration history shows that sessions table was already made, but you don't have real table.

so following below

python manage.py migrate --fake sessions zero
# then your sessions migrate will be
python manage.py showmigrations
sessions
 [ ] 0001_initial
# then migrate with --fake-initial again
python manage.py migrate --fake-initial

Then try again.

Solution 2:

I'm using django-v-3Here is the answer how to solve this issue?

1. python manage.py migrate --fake2. python manage.py migrate --fake-initial3. Then write python manage.py runserver

Enjoy

If facing issue use python manage.py help. I hope that you will get the solution.

Post a Comment for "Programmingerror: Relation "django_session" Does Not Exist"