Yesterday it worked fine when I ran the server but today I am getting this:
****Environment: Request Method: GET Request URL: http://192.168.2.206:8080/home/ Django Version: 1.1.1 Python Version: 2.6.5 Installed Applications: ['django.contrib.auth', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.markup', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.comments', 'mysite.registration', 'mysite.profiles', 'mysite.epw', 'mysite.remember_me', 'mysite.avatar', 'mysite.django_documents', 'mysite.inlines', 'mysite.blog', 'mysite.forum', 'tagging'] Installed Middleware: ('django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'mysite.remember_me.views.AutoLogout') Traceback: File "/usr/lib/pymodules/python2.6/django开发者_JS百科/core/handlers/base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/pymodules/python2.6/django/views/decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/usr/lib/pymodules/python2.6/django/utils/decorators.py" in _wrapped_view 48. response = view_func(request, *args, **kwargs) File "/home/karthik/Desktop/EPW_LOCAL/mysite/../mysite/remember_me/views.py" in remember_me_login 81. result_of_update, result_of_category, result_of_cover, result_of_latest, result_of_block, result_of_footer, result_of_research = common_blocks() File "/home/karthik/Desktop/EPW_LOCAL/mysite/../mysite/epw/views.py" in common_blocks 332. result_of_update = display_updated_date() File "/home/karthik/Desktop/EPW_LOCAL/mysite/../mysite/epw/views.py" in display_updated_date 1357. updated_obj = pdf_database.objects.filter(updated_date__gte = previous_datetime, updated_date__lte = cur_datetime).order_by("-updated_date")[0] File "/usr/lib/pymodules/python2.6/django/db/models/query.py" in __getitem__ 159. return list(qs)[0] **Exception Type: IndexError at /home/ Exception Value: list index out of range******
Your queryset has 0 results. specifically this one:
updated_obj = pdf_database.objects.filter(updated_date__gte = previous_datetime, updated_date__lte = cur_datetime).order_by("-updated_date")
yesterday its working fine when run server today i am getting like this
Add a new pdf_database
object from the admin or console and this view should be back running fine like yesterday
精彩评论