Python Django访问管理页面并添加新url-初学者

Python Django访问管理页面并添加新url-初学者,python,django,eclipse,Python,Django,Eclipse,我在eclipse中创建了一个DJango项目。后来我添加了一个新的应用程序(R-CLick Project folder-->DJANGO-->Create application(manage.py startapp)) 我把它命名为超级 然后我又创建了另一个新的应用程序(使用上述相同的步骤),并将其命名为Human 在我的项目中,我创建了2个应用程序(在eclipse中,它显示为2个包) 我在包Super中有一个名为admin.py的文件 代码如下: from django.contrib

我在eclipse中创建了一个DJango项目。后来我添加了一个新的应用程序(
R-CLick Project folder-->DJANGO-->Create application(manage.py startapp)

我把它命名为超级

然后我又创建了另一个新的应用程序(使用上述相同的步骤),并将其命名为
Human

在我的项目中,我创建了2个应用程序(在eclipse中,它显示为2个包)

我在包
Super
中有一个名为
admin.py
的文件

代码如下:

from django.contrib import admin
from Super.models import People
from Human.models import NormalHuman

admin.site.register(People)
admin.site.register(NormalHuman)
我甚至在
Settings.py
文件中注册了这两个新应用程序

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'Super',
    'Human',
    # Uncomment the next line to enable the admin:
     'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from Human.models import NormalHuman
admin.autodiscover()

urlpatterns = patterns('',

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^normal/', NormalHuman),
)
我还对
url.py
文件进行了更改

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'Super',
    'Human',
    # Uncomment the next line to enable the admin:
     'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from Human.models import NormalHuman
admin.autodiscover()

urlpatterns = patterns('',

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^normal/', NormalHuman),
)
我想解决的问题:

1.)重新启动服务器后,当我尝试导航到url
127.0.0.1:9095/normal


2.)我需要将
NormalHuman
添加到管理员页面,以便我可以访问其内容。

您已经注册了管理员url,因此无需添加

url(r'^normal/', NormalHuman), url(r“^normal/”,NormalHuman), 查看NormalHuman模型的内容


只需点击127.0.0.1:9095/admin/human/normalhuman即可查看normalhuman模型的内容。

normalhuman
是模型的名称,而不是视图的名称。URL只映射到视图。要编辑你的人类和超级英雄,你需要转到
/admin
。你能显示这两个应用的URL文件的代码吗?你应该重新阅读管理员的教程页面。当你向管理员添加一个模型时,它没有说你需要添加一个新的URL。相反,它确切地解释了您只需要注册它。无论如何,将URL映射到模型没有任何意义。因此,您所说的是,我不需要编辑
URL.py
类。然而,我仍然以404错误结束。是的,它说的是404。你在两个应用程序中都有单独的URL.py文件吗?没有,我只有一个。 127.0.0.1:9095/admin/human/normalhuman