Wednesday, July 7, 2021

Re: ProgrammingError - relationship does not exist

in admin.py put this code to see. 
@admin.site.register (shop) 


Le mer. 7 juil. 2021 à 00:16, Stathis Angelou <stakathiki@gmail.com> a écrit :
Good evening all, i have created a new app and added a model. Added the app under installed apps, and run python manage.py makemigrations and migrate and everything worked as expected.

But i believe there is an issue with the admin.py file

from django.contrib import admin

# Register your models here.
from django.contrib.gis.admin import OSMGeoAdmin
from .models import Shop

@admin.register(Shop)
class ShopAdmin(OSMGeoAdmin):
    list_display = ('name', 'location')

Error message:
"ProgrammingError at /admin/shops/shop/relation "shops_shop" does not exist LINE 1: SELECT COUNT(*) AS "__count" FROM "shops_shop" "

Any advice or hint would be really appreciated 
Kind Regards

Stathis 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/60ca7670-d423-49e1-9d4a-ea978e193dd4n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKRM%3DdFUzUj37o%3DxgqfQZU-Dj9FeH7CTZCUbCpRdkZ-nHAM-oQ%40mail.gmail.com.

No comments:

Post a Comment