This tutorial applies to the trunk version of Django and this particular part requires a very recent checkout (from not older than the 18th of this month). You can normally get the version of Django you're using by running `django-admin.py --version` :-)
The problem you have seems to be related to the age of your version of Django. You will need a very recent checkout (or the Alpha released last night) for this :-) -- Horst On Tue, Jul 22, 2008 at 11:02 AM, Morgan Packard <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm going through the tutorial at > http://www.djangoproject.com/documentation/tutorial01/, > and am having trouble with the second page (http:// > www.djangoproject.com/documentation/tutorial01/). > > The tutorial instructs me to add "admin.site.register(Poll)" to the > bottom of models.py. I've done that, and now the sever gives me the > following error: AttributeError: 'module' object has no attribute > 'site' > > Everything else has worked perfectly up to this point. This is how my > models.py looks: > > ============================================ > from django.db import models > from django.contrib import admin > 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 > > admin.site.register(Poll) > ============================================ > > One possible clue is the fact that the urls.py Django generated for me > differes from the one in the tutorial. The urls.py Django gave me is > missing the following lines which are shown in the tutorial: > > ============================================ > from django.contrib import admin > admin.autodiscover() > ============================================ > > One last question: how can I tell precisely which version of django I > have? There doesn't seem to be a version number in the readme. > > thanks so much! > > -Morgan > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---