简体   繁体   English

Django模型没有在Admin.py中显示

[英]Django Models not showing in Admin.py

I have looked through the other answers extensively, but I just know this is going to turn out to be a silly oversight on my part. 我已经广泛地查看了其他答案,但我知道这对我来说是一个愚蠢的疏忽。

I am a noob on an AWS Bitnami stack. 我是AWS Bitnami堆栈上的菜鸟。 Just trying to make of simple model show up in my admin. 只是想在我的管理员中显示简单的模型。

Models.py: Models.py:

    from __future__ import unicode_literals

from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Create your models here.



# Scrollbar ######################################################
@python_2_unicode_compatible
class Marquee(models.Model):
    scrollbar_content = models.CharField(max_length = 2000)

    def __str__(self):
        return self.scrollbar_content

admin.py: admin.py:

from django.contrib import admin

# Register your models here.
from .models import Marquee

admin.site.register(Marquee)

autodiscover() is in urls.py file autodiscover()位于urls.py文件中

my app name is under INSTALLED APPS in settings.py: 我的应用名称在settings.py中的INSTALLED APPS下:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'movierec',

]

My PostgreSQL database is working and I have checked it through the Django shell. 我的PostgreSQL数据库正在运行,我已经通过Django shell进行了检查。

Again, I'm sure I've overlooked something foolish. 再说一遍,我确信我忽视了一些愚蠢的事情。 I hope not to waste your time. 我希望不要浪费你的时间。

Python 2.7 Django 1.9.7 AWS Bitnami stack Python 2.7 Django 1.9.7 AWS Bitnami堆栈

Thank you for your patience. 感谢您的耐心等待。

Sorry for the trouble. 抱歉,添麻烦了。

I forgot to reload / restart apache and my changes weren't showing up. 我忘了重新加载/重启apache,我的更改没有显示出来。

Thank you everyone for your help! 谢谢你们每一个人的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM