<p>检查所有<a href="https://docs.djangoproject.com/en/dev/ref/contrib/admin/" rel="noreferrer">these</a>:</p>
<blockquote>
<p>There are seven steps in activating the Django admin site:</p>
<ol>
<li>Add 'django.contrib.admin' to your INSTALLED_APPS setting.</li>
<li>The admin has four dependencies - django.contrib.auth, django.contrib.contenttypes, django.contrib.messages and
django.contrib.sessions. If these applications are not in your
INSTALLED_APPS list, add them.</li>
<li>Add django.contrib.messages.context_processors.messages to TEMPLATE_CONTEXT_PROCESSORS and MessageMiddleware to
MIDDLEWARE_CLASSES. (These are both active by default, so you only
need to do this if you’ve manually tweaked the settings.)</li>
<li>Determine which of your application’s models should be editable in the admin interface.</li>
<li>For each of those models, optionally create a ModelAdmin class that encapsulates the customized admin functionality and options for
that particular model.</li>
<li>Instantiate an AdminSite and tell it about each of your models and ModelAdmin classes.</li>
<li>Hook the AdminSite instance into your URLconf.</li>
</ol>
</blockquote>
<ul>
<li>你的已安装应用中是否有所有其他管理依赖项?</li>
<li>你的url.py中有<code>admin.autodiscover()</code>吗?</li>
</ul>
<p>另外,我认为您的代码应该更像这样:</p>
<pre><code>from projectname.appname.models import Appname
from django.contrib import admin
class AppnameAdmin(admin.ModelAdmin):
fieldsets = [various field sets and fields etc ]
admin.site.register(Appname,AppnameAdmin)
</code></pre>