4
我剛在我的Mac OS X雪豹上安裝了django,並且遇到了一些問題。 我只做了一個非常簡單的項目,只包含一個簡單的應用程序。
該應用程序只包含一個模型,它是一項任務。運行syncdb時,創建任務表時沒有任何問題,並且我被要求創建新用戶。
一切工作正常,我可以登錄等,但我的應用程序不顯示。應用程序不會顯示在Django管理員
這是我的項目中的一些代碼。
settings.py
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'work.todo',
)
待辦事項/ admin.py
from work.todo import Task
from django.contrib import admin
admin.site.register(Task)
urls.py
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^work/', include('work.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)
待辦事項/ models.py
from django.db import models
class Task(models.Model):
text = models.CharField(max_length=200)
done = models.BooleanField()
也許這是值得一提的還有在工作和工作/ TODO文件夾__init__.py
。
乾杯, nandarya
由於忘記
models
,它解決了這個問題!你想交換眼睛?^__^ – nandarya 2009-09-04 11:41:06相信我,你不想要這些眼睛。只要問問坐在我旁邊工作的人:) – 2009-09-04 13:29:21