django-simple-sso icon indicating copy to clipboard operation
django-simple-sso copied to clipboard

psycopg2.errors.UndefinedTable: relation "sso_server_consumer" does not exist

Open saikrishnavadali05 opened this issue 4 years ago • 1 comments

I am working on implementing Django-Simple-SSO to our python based platform. I am following this blog to implement SSO:

https://medium.com/@MicroPyramid/django-single-sign-on-sso-to-multiple-applications-64637da015f4

This code is the step number 3 on the server side of django-simple-sso.

from simple_sso.sso_server.models import Token, Consumer

Consumer.objects.create(public_key='your_application_public_key', private_key='your_application_private_key', name='your_application_name')

psycopg2.errors.UndefinedTable: relation "sso_server_consumer" does not exist -- this is the error I am getting as soon as I run the above code in django shell. Can someone please help me on how to solve this error?

I have run both makemigrations and migrate commands. But, still getting the same error.

I am able to see the Consumers table in the django-admin page under the heading SSO_SERVER. But, when I click on that Consumers table, I am getting this error page :

ProgrammingError at /admin/sso_server/consumer/ relation "sso_server_consumer" does not exist LINE 1: SELECT COUNT(*) AS "__count" FROM "sso_server_consumer" And also why is that Token imported? As it was not used anywhere in that sso blog post.

I have asked this question on stackoverflow as well : https://stackoverflow.com/questions/64281534/psycopg2-errors-undefinedtable-relation-sso-server-consumer-does-not-exist Thank you

saikrishnavadali05 avatar Oct 12 '20 05:10 saikrishnavadali05

please make sure you have added 'simple_sso.sso_server' in your installed apps and run python manage.py migrate

Hardeepsingh980 avatar Nov 06 '20 09:11 Hardeepsingh980