Будь я проклят, если смогу понять, почему мои модели не отображаются в админке. Я работаю над проектом под названием btre_project, и эта проблема беспокоит меня, помогите найти решение
моделей.py в приложении Listing:
from django.db import models
from datetime import datetime
from realtors.models import Realtor
class Listing(models.Model):
realtor=models.ForeignKey(Realtor,on_delete=models.DO_NOTHING)
models.CharField(max_length=100)
state=models.CharField(max_length=100)
zipcode=models.CharField(max_length=20)
description=models.TextField(blank=True)
price=models.IntegerField()
bedrooms=models.IntegerField()
bathrooms=models.DecimalField(max_digits=2,decimal_places=1)
garage=models.IntegerField()
sqft=models.IntegerField()
lot_size=models.DecimalField(max_digits=5,decimal_places=1)
photo_main=models.ImageField(upload_to='photos/%Y/%m/%d/')
photo_1=models.ImageField(upload_to='photos/%Y/%m/%d/',blank=True)
photo_2=models.ImageField(upload_to='photos/%Y/%m/%d/',blank=True)
photo_3=models.ImageField(upload_to='photos/%Y/%m/%d/',blank=True)
photo_4=models.ImageField(upload_to='photos/%Y/%m/%d/',blank=True)
photo_5=models.ImageField(upload_to='photos/%Y/%m/%d/',blank=True)
photo_6=models.ImageField(upload_to='photos/%Y/%m/%d/',blank=True)
is_published=models.BooleanField(default=True)
list_date=models.DateTimeField(default=datetime.now,blank=True)
def __str__(self):
return self.title
admin.py приложение листинга:
from django.contrib import admin
from .models import Listing
class ListingAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'is_published', 'price', 'list_date',
'realtor')
list_display_links=('id','title')
list_filter=('realtor',)
admin.site.register(Listing)
projects settings.py
INSTALLED_APPS = [
'pages.apps.PagesConfig',
'listings.apps.ListingsConfig',
'realtors.apps.RealtorsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
urls.py:
from django.contrib import admin
from django.urls import path,include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('',include('pages.urls')),
path('listings/',include('listings.urls')),
path('admin/', admin.site.urls),
] + static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
Помогите найти решение