title: List index out of range on the Django App while running the development server
body: <p>I just got a new job working for a website and I am trying to get a development server working on my work computer. I've copied all the configurations and what not and I am still getting errors.</p>
  
  <p>When I try to display the front page I get</p>
  
  <pre><code>list index out of range
  </code></pre>
  
  <p>The exception is being raised</p>
  
  <pre><code>python2.6/site-packages/Django-1.3-py2.6.egg/django/db/models/query.py in __getitem__, line 190
  </code></pre>
  
  <p>Here is the traceback information.</p>
  
  <pre><code>Environment:
  
  
  Request Method: GET
  Request URL: http://localhost:8000/
  
  Django Version: 1.3
  Python Version: 2.6.5
  Installed Applications:
  ['django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.admin',
   'django.contrib.sites',
   'django.contrib.flatpages',
   'django.contrib.markup',
   'south',
   'radio.frontend',
   'radio.events',
   'radio.library',
   'radio.logs',
   'radio.station',
   'radio.staff',
   'gravatar',
   'djcelery',
   'gunicorn']
  Installed Middleware:
  ('django.middleware.common.CommonMiddleware',
   'django.contrib.sessions.middleware.SessionMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.middleware.doc.XViewMiddleware',
   'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')
  
  
  Traceback:
  File "/home/wluw/wluw/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/core/handlers/base.py" in get_response
    111.                         response = callback(request, *callback_args, **callback_kwargs)
  File "/home/wluw/wluw/wluw/radio/frontend/views.py" in home
    20.     schedule = Schedule.objects.get_current_schedule(now)
  File "/home/wluw/wluw/wluw/radio/station/managers.py" in get_current_schedule
    64.         return results[0]
  File "/home/wluw/wluw/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/db/models/query.py" in __getitem__
    190.             return list(qs)[0]
  
  Exception Type: IndexError at /
  Exception Value: list index out of range
  </code></pre>
  
  <p>Here is some of the code I've got that is adding to the error</p>
  
  <pre><code>class ScheduleManager(models.Manager):
      def get_current_schedule(self, when):
          results = self.filter(start_date__lte=when, end_date__gte=when).order_by('-start_date')
          #try:
          #if(results[0]):
          return results[0]
          #else:
             # return "null"
          #
          #except IndexError:
              #raise self.model.DoesNotExist
  
      def get_current_schedule_or_404(self, when):
          try:
              return self.get_current_schedule(when)
          except self.model.DoesNotExist:
              raise Http404
  </code></pre>
  
  <p>I am still not to familiar with python so any suggestions of where to fiddle around with the code would be great.
  I have a feeling it has something to do with database not being populated with data, but I added in stuff and I still get the error.</p>
  
  <p>Thanks for any help you may give.</p>
  
  <p>If you need more info just let me know.</p>