title: Stuck with "Practical Django Projects"
body: <p>Got another error with this tutorial. Should I give up and move on to another? …
  Anyway.. here it goes:</p>
  
  <pre><code>Environment:
  
  Request Method: GET
  Request URL: http://127.0.0.1:8000/admin/
  Django Version: 1.2.5
  Python Version: 2.5.4
  Installed Applications:
  ['django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.sites',
   'django.contrib.messages',
   'django.contrib.admin',
   'django.contrib.flatpages',
   'cms.search',
   'coltrane',
   'tagging']
  Installed Middleware:
  ('django.middleware.common.CommonMiddleware',
   'django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware')
  
  
  Traceback:
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
    91.                         request.path_info)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in resolve
    215.             for pattern in self.url_patterns:
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in _get_url_patterns
    244.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in _get_urlconf_module
    239.             self._urlconf_module = import_module(self.urlconf_name)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/utils/importlib.py" in import_module
    35.     __import__(name)
  
  Exception Type: SyntaxError at /admin/
  Exception Value: invalid syntax (urls.py, line 6)
  </code></pre>
  
  <p>Here's the urls:</p>
  
  <pre><code>from django.conf.urls.defaults import *
  
  from coltrane.models import Entry
  
  entry_info_dict = {
      'queryset': Entry.objects.all(),
      'date_field': 'pub_date',
  }
  
  urlpatterns = patterns('django.views.generic.date_based',
      (r'^$', 'archive_index', entry_info_dict, 'coltrane_entry_archive_index'),
  
      (r'^(?P&lt;year&gt;\d{4})/$', 'archive_year', entry_info_dict, 'coltrane_entry_archive_year'),
  
      (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;\w{3})/$', 'archive_month', entry_info_dict, 'coltrane_entry_archive_month'),
  
      (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;\w{3})/(?P&lt;day&gt;\d{2})/$', 'archive_day', entry_info_dict, 'coltrane_entry_archive_day'),
  
      (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;\w{3})/(?P&lt;day&gt;\d{2})/(?P&lt;slug&gt;[-\w]+)/$', 'object_detail', entry_info_dict, 'coltrane_entry_detail'),
  )
  </code></pre>
  
  <p>I guess the error is on entry_info_dict. Any help? Thanks in advance.</p>
  
  <p>Here's the models.py:</p>
  
  <pre><code>import datetime
  from django.conf import settings
  from django.db import models
  from django.contrib.auth.models import User
  from tagging.fields import TagField
  from markdown import markdown
  import tagging
  
  class Category(models.Model):
      title = models.CharField(max_length=250, help_text='Maximum 250 characters.')
      slug = models.SlugField(help_text="Suggested value automatically generated from title. Must be unique.")
      description = models.TextField()
  
      class Meta:
          ordering = ['title']
          verbose_name_plural = "Categories"
  
      def __unicode__(self):
          return self.title
  
      @models.permalink
      def get_absolute_url(self):
          return ('coltrane_category_detail', (), { 'slug': self.slug })
  
  class Entry(models.Model):
      LIVE_STATUS = 1
      DRAFT_STATUS = 2
      HIDDEN_STATUS = 3
      STATUS_CHOICES = (
          (LIVE_STATUS, 'Live'),
          (DRAFT_STATUS, 'Draft'),
          (HIDDEN_STATUS, 'Hidden'),
      )
  
      # Core fields
      title = models.CharField(max_length=250)
      excerpt = models.TextField(blank=True)
      body = models.TextField()
      pub_date = models.DateTimeField(default=datetime.datetime.now)
  
      # Metadata
      author = models.ForeignKey(User)
      enable_comments = models.BooleanField(default=True)
      featured = models.BooleanField(default=False)
      slug = models.SlugField(unique_for_date='pub_date')
      status = models.IntegerField(choices=STATUS_CHOICES, default=LIVE_STATUS)
  
      # Categorization
      categories = models.ManyToManyField(Category)
      tags = TagField()
  
      # Fields to store generated HTML
      excerpt_html = models.TextField(editable=False, blank=True)
      body_html = models.TextField(editable=False, blank=True)
  
      class Meta:
          verbose_name_plural = "Entries"
          ordering = ['-pub_date']
  
      def save(self, force_insert=False, force_update=False):
          self.body_html = markdown(self.body)
          if self.excerpt:
              self.excerpt_html = markdown(self.excerpt)
          super(Entry, self).save(force_insert, force_update)
  
      def __unicode__(self):
          return self.title
  
      @models.permalink
      def get_absolute_url(self):
          return ('coltrane_entry_detail', (), { 'year': self.pub_date_strftime("%Y"), 'month': self.pub_date_strftime("%b").lower(), 'day': self.pub_date.strftime("%d"), 'slug': self.slug })
  </code></pre>
  
  <p>Here's the main urls.py</p>
  
  <pre><code>from django.conf.urls.defaults import *
  from django.contrib import admin
  import settings
  admin.autodiscover()
  
  from coltrane.models. import Entry
  
  urlpatterns = patterns('',
      # Example:
      # (r'^cms/', include('cms.foo.urls')),
  
      # Uncomment the admin/doc line below 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)),
      (r'^search/$', 'cms.search.views.search'),
      (r'tiny_mce/(?P&lt;path&gt;.*)$', 'django.views.static.serve', { 'document_root': '/Users/danielcorreia/Sites/tinymce/jscripts/tiny_mce' }),
      (r'^weblog/', include('coltrane.urls')),
      (r'', include('django.contrib.flatpages.urls')),
  )
  </code></pre>