Hi! Help me please to solve one tutorial problem.
Now I'm reading the 2nd part of the tutorial and have stuck with adding polls app to the Django admin.
Everything worked fine in the tutorial until I reached "Make the poll app modifiable in the admin" part.
Here is the link to the tutorial page I'm currently at:
https://docs.djangoproject.com/en/1.3/intro/tutorial02/
I have already added admin.py file and now have mysite/polls directory with the following content:
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 06.10.2011 23:54 94 admin.py
-a--- 07.10.2011 0:21 609 models.py
-a--- 06.10.2011 23:39 1478 models.pyc
-a--- 06.10.2011 23:13 399 tests.py
-a--- 06.10.2011 23:13 27 views.py
-a--- 06.10.2011 23:13 0 __init__.py
-a--- 06.10.2011 23:19 150 __init__.pyc
admin.py contains this:
-----------------------
from polls.models import Poll
from django.contrib import admin
admin.site.register(Poll)
-----------------------
If this can help, models.py have this content:
-----------------------
from django.db import models
import datetime
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.question
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()
def __unicode__(self):
return self.choice
-----------------------
I restarted the Django development server several times.
And I'm looking here http://127.0.0.1:8000/admin/ for the "poll" app to appear. But it doesn't =( Still only "Auth" and "Sites" here.
Tell me please - did I miss something? Or did the tutorial miss something?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/c0WVz5UjgFUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment