Ich habe gerade django auf meinem mac os x snow leopard installiert und habe einige Probleme mit ihm. Ich habe gerade ein sehr einfaches Projekt gemacht, das nur eine einfache App enthält.
Die App enthält nur ein Modell und das ist eine Aufgabe. Beim Ausführen von syncdb wird die Tabelle für Aufgaben ohne Probleme erstellt und ich werde aufgefordert, einen neuen Benutzer zu erstellen.
Alles funktioniert gut, ich kann mich anmelden usw., aber meine App wird nicht angezeigt.
Hier ist etwas Code aus meinem Projekt.
einstellungen.py
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'work.todo',
)
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)),
)
todo/models.py
from django.db import models
class Task(models.Model):
text = models.CharField(max_length=200)
done = models.BooleanField()
Vielleicht ist es erwähnenswert, dass es eine __init__.py
sowohl im Ordner Arbeit als auch im Ordner Arbeit/Todo.
Zum Wohl, nandarya