模型未显示在管理页面中(Django on heroku)

时间:2015-03-15 18:59:21

标签: python django heroku admin models

我的models.py包含3个型号,但它们没有显示在我的管理页面中。我尝试在admin.py中注册我的模型,并添加了admin.autodiscover(),但这些事情似乎没有任何区别。

我还尝试将我的应用名称添加到settings.py中的INSTALLED_APPS,但这会导致应用程序错误(应用程序中发生错误,无法提供您的页面。请稍后重试。)

有关如何修复的任何建议吗?

以下是我的models.py:

from django.db import models
import numpy as np

class User(models.Model):
"""
Use OAuth to create user account
"""
    videos = models.CategoryFields()
    name = models.CharField()
    email = models.EmailField()
    create_date = models.DateTimeField()

class Video(models.Model):
"""
Contains video, user who created video, create date, video title, average     rating, and all ratings
"""
    # video = models.FileField()... need S3 to store
    pub_date = models.DateTimeField('date published')
    user = models.CharField()
    title = models.CharField(max_length=100)
    #ratings = ListField()
    avg_rating = views.getAverageRating()

class Rating(models.Model):
"""
Contains numeric rating, parameter, video which was rated, user ID, response   time 
"""
    rating = models.IntegerField(default=0)
    user = models.CharField()
    pub_date = models.DateTimeField('date published')
    response_time = models.TimeField()

以下是我的管理页面现在的样子。 "用户"只是所有的超级用户。

Django admin page

谢谢!

0 个答案:

没有答案