TypeError at /search/
'NoneType' object has no attribute '__getitem__'Request Method: POST
Request URL:
http://stories.everypony.ru/search/Django Version: 1.5
Exception Type: TypeError
Exception Value: 'NoneType' object has no attribute '__getitem__'
Exception Location: ./ponyFiction/views/search.py in search_action, line 91
Python Executable: /usr/bin/uwsgi-core
Python Version: 2.7.3
Python Path: ['.',
'',
'/home/ep/www/stories/.virtualenvs/ponyFiction/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/home/ep/www/stories/.virtualenvs/ponyFiction/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg',
'/home/ep/www/stories/.virtualenvs/ponyFiction/src/django-cacheops',
'/home/ep/www/stories/.virtualenvs/ponyFiction/lib/python2.7',
'/home/ep/www/stories/.virtualenvs/ponyFiction/lib/python2.7/plat-linux2',
'/home/ep/www/stories/.virtualenvs/ponyFiction/lib/python2.7/lib-tk',
'/home/ep/www/stories/.virtualenvs/ponyFiction/lib/python2.7/lib-old',
'/home/ep/www/stories/.virtualenvs/ponyFiction/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/home/ep/www/stories/.virtualenvs/ponyFiction/local/lib/python2.7/site-packages']
Server time: Срд, 28 Авг 2013 23:18:34 +0400
Traceback Switch to copy-and-paste view
/home/ep/www/stories/.virtualenvs/ponyFiction/local/lib/python2.7/site-packages/django/core/handlers/base.py in get_response
response = callback(request, *callback_args, **callback_kwargs) ...
▶ Local vars
./ponyFiction/views/search.py in search_main
return search_action(request, postform) ...
▶ Local vars
/home/ep/www/stories/.virtualenvs/ponyFiction/local/lib/python2.7/site-packages/django/utils/decorators.py in _wrapped_view
response = view_func(request, *args, **kwargs) ...
▶ Local vars
./ponyFiction/views/search.py in search_action
for res in raw_result['matches']: ...
▶ Local vars
Request information
GET
No GET data
POSTVariable Value
search_min_size u''
characters_select u'4'
search_query u''
categories_select u'12'
search_max_size u''
button_submit u'\u0418\u0441\u043a\u0430\u0442\u044c!'
search_type u'0'
sort_type u'3'
csrfmiddlewaretoken u'mdiW23ghLLwnhAazRq6ZioAOeJz6zVnA'
FILES
No FILES data
COOKIESVariable Value
__utmz '207989446.1360609698.111.2.utmcsr=vk.com|utmccn=(referral)|utmcmd=referral|utmcct=/rubronycon'
stories_gr '4'
phpbb3_13353_u '3296'
csrftoken 'mdiW23ghLLwnhAazRq6ZioAOeJz6zVnA'
__utma '207989446.1793440079.1351934350.1377700781.1377717266.262'
phpbb3_13353_sid '9b996a91d173dc4bb1c91f46da6b8746'
phpbb3_13353_k '2be268120311a6cc'
__utmb '207989446.1.10.1377717266'
__utmc '207989446'
METAVariable Value
wsgi.multiprocess True
HTTP_REFERER 'http://stories.everypony.ru/search/'
SCRIPT_NAME u''
REQUEST_METHOD 'POST'
PATH_INFO u'/search/'
SERVER_PROTOCOL 'HTTP/1.1'
QUERY_STRING ''
CONTENT_LENGTH '945'
HTTP_USER_AGENT 'Opera/9.80 (Windows NT 6.1; Win64; x64) Presto/2.12.388 Version/12.10'
HTTP_CONNECTION 'Keep-Alive'
HTTP_COOKIE '__utma=234145628.93956041.1360609953.1360609953.1360609953.1; stories_gr=4; csrftoken=mdiW23ghLLwnhAazRq6ZioAOeJz6zVnA; phpbb3_13353_u=3296; phpbb3_13353_k=2be268120311a6cc; phpbb3_13353_sid=9b996a91d173dc4bb1c91f46da6b8746; __utma=207989446.1793440079.1351934350.1377700781.1377717266.262; __utmb=207989446.1.10.1377717266; __utmc=207989446; __utmz=207989446.1360609698.111.2.utmcsr=vk.com|utmccn=(referral)|utmcmd=referral|utmcct=/rubronycon'
SERVER_NAME 'stories.everypony.ru'
REMOTE_ADDR '109.205.252.49'
wsgi.url_scheme 'http'
SERVER_PORT '80'
uwsgi.node 'everypony'
DOCUMENT_ROOT '/opt/nginx/html'
CONTENT_TYPE 'multipart/form-data; boundary=----------2OiUc1EE9pFgmSBzyEA3jZ'
wsgi.input <uwsgi._Input object at 0xd3a3c0>
HTTP_HOST 'stories.everypony.ru'
wsgi.multithread False
HTTP_CONTENT_TYPE 'multipart/form-data; boundary=----------2OiUc1EE9pFgmSBzyEA3jZ'
REQUEST_URI '/search/'
HTTP_ACCEPT 'text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1'
wsgi.version (1, 0)
wsgi.run_once False
wsgi.errors <open file 'wsgi_errors', mode 'w' at 0x23d58a0>
REMOTE_PORT '23288'
HTTP_ACCEPT_LANGUAGE 'ru-RU,ru;q=0.9,en;q=0.8'
uwsgi.version '1.2.3-debian'
HTTP_CONTENT_LENGTH '945'
wsgi.file_wrapper ''
CSRF_COOKIE u'mdiW23ghLLwnhAazRq6ZioAOeJz6zVnA'
HTTP_ACCEPT_ENCODING 'gzip, deflate'
Settings
Using settings module ponyFiction.settingsSetting Value
STORIES_COUNT {'main': 10, 'page': 10, 'stream': 20}
STATIC_ROOT './ponyFiction/static'
USE_THOUSAND_SEPARATOR False
CSRF_COOKIE_SECURE False
LANGUAGE_CODE 'ru-RU'
ROOT_URLCONF 'ponyFiction.urls'
MANAGERS ()
ACCOUNT_ACTIVATION_DAYS 5
CACHEOPS {'*.*': ('just_enable', 3600),
'auth.*': ('all', 3600),
'auth.user': ('get', 900),
'ponyFiction.Category': ('all', 2592000),
'ponyFiction.Chapter': ('get', 10800),
'ponyFiction.Character': ('all', 2592000),
'ponyFiction.Classifier': ('all', 2592000),
'ponyFiction.Comment': ('get', 10800),
'ponyFiction.Rating': ('all', 2592000),
'ponyFiction.Story': ('get', 10800)}
ALLOWED_HOSTS ['*']
MESSAGE_STORAGE 'django.contrib.messages.storage.fallback.FallbackStorage'
RECAPTCHA_PRIVATE_KEY u'********************'
EMAIL_SUBJECT_PREFIX '[Django] '
SEND_BROKEN_LINK_EMAILS False
STATICFILES_FINDERS ('django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder')
SESSION_CACHE_ALIAS 'default'
SESSION_COOKIE_DOMAIN None
SESSION_COOKIE_NAME 'sessionid'
CHAPTER_ALLOWED_ATTRIBUTES {'a': ['href', 'rel', 'title'],
'footnote': ['id'],
'img': ['src', 'alt', 'title', 'width', 'height'],
'p': ['align'],
'span': ['align']}
TIME_INPUT_FORMATS ('%H:%M:%S', '%H:%M')
DATABASES {'default': {'ENGINE': 'django.db.backends.mysql',
'HOST': '',
'NAME': 'ep_stories',
'OPTIONS': {},
'PASSWORD': u'********************',
'PORT': '',
'TEST_CHARSET': None,
'TEST_COLLATION': None,
'TEST_MIRROR': None,
'TEST_NAME': None,
'TIME_ZONE': 'Europe/Moscow',
'USER': 'ep_stories'}}
CHAPTER_ALLOWED_TAGS ['b',
'i',
'strong',
'em',
's',
'u',
'h3',
'h4',
'h5',
'p',
'span',
'br',
'hr',
'footnote',
'img',
'a',
'ul',
'ol',
'li',
'blockquote',
'sup',
'sub',
'pre',
'small',
'tt']
STATIC_URL '/static/'
RECAPTCHA_PUBLIC_KEY u'********************'
FILE_UPLOAD_PERMISSIONS None
FILE_UPLOAD_HANDLERS ('django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler')
DEFAULT_CONTENT_TYPE 'text/html'
APPEND_SLASH True
FIRST_DAY_OF_WEEK 0
DATABASE_ROUTERS []
YEAR_MONTH_FORMAT 'F Y'
STATICFILES_STORAGE 'django.contrib.staticfiles.storage.StaticFilesStorage'
CACHES {'default': {'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211'}}
SERVER_EMAIL 'root@localhost'
SESSION_COOKIE_PATH '/'
COMMENTS_COUNT {'author_page': 10, 'main': 5, 'page': 50, 'stream': 50}
MIDDLEWARE_CLASSES ('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')
USE_I18N True
THOUSAND_SEPARATOR ','
SECRET_KEY u'********************'
PUBLISH_SIZE_LIMIT 1000
LANGUAGE_COOKIE_NAME 'django_language'
DEFAULT_INDEX_TABLESPACE ''
TRANSACTIONS_MANAGED False
LOGGING_CONFIG 'django.utils.log.dictConfig'
SIGNING_BACKEND 'django.core.signing.TimestampSigner'
TEMPLATE_LOADERS ('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader')
WSGI_APPLICATION 'ponyFiction.wsgi.application'
SETTINGS_MODULE 'ponyFiction.settings'
TEMPLATE_DEBUG True
X_FRAME_OPTIONS 'SAMEORIGIN'
CSRF_COOKIE_NAME 'csrftoken'
FORCE_SCRIPT_NAME None
USE_X_FORWARDED_HOST False
COMMENT_MIN_LENGTH 70
SESSION_COOKIE_SECURE False
CSRF_COOKIE_DOMAIN None
FILE_CHARSET 'utf-8'
DEBUG True
SESSION_FILE_PATH None
DEFAULT_FILE_STORAGE 'django.core.files.storage.FileSystemStorage'
INSTALLED_APPS ('cacheops',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'ponyFiction',
'django.contrib.admin',
'debug_toolbar',
'registration')
LANGUAGES (('af', 'Afrikaans'),
('ar', 'Arabic'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('be', 'Belarusian'),
('bn', 'Bengali'),
('br', 'Breton'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('el', 'Greek'),
('en', 'English'),
('en-gb', 'British English'),
('eo', 'Esperanto'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('es-ve', 'Venezuelan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy-nl', 'Frisian'),
('ga', 'Irish'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hu', 'Hungarian'),
('ia', 'Interlingua'),
('id', 'Indonesian'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('kk', 'Kazakh'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('lb', 'Luxembourgish'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('nb', 'Norwegian Bokmal'),
('ne', 'Nepali'),
('nl', 'Dutch'),
('nn', 'Norwegian Nynorsk'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('sw', 'Swahili'),
('ta', 'Tamil'),
('te', 'Telugu'),
('th', 'Thai'),
('tr', 'Turkish'),
('tt', 'Tatar'),
('udm', 'Udmurt'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('vi', 'Vietnamese'),
('zh-cn', 'Simplified Chinese'),
('zh-tw', 'Traditional Chinese'))
USE_L10N True
COMMENTS_ALLOW_PROFANITIES False
ALLOWED_ATTRIBUTES {'a': ['href', 'rel', 'title'],
'img': ['src', 'alt', 'title', 'width', 'height']}
STATICFILES_DIRS ()
PREPEND_WWW False
CACHEOPS_REDIS {'host': 'localhost', 'port': 6379, 'socket_timeout': 3}
COMMENTS_ORPHANS 5
SESSION_COOKIE_HTTPONLY True
DEBUG_PROPAGATE_EXCEPTIONS False
MONTH_DAY_FORMAT 'F j'
LOGIN_URL '/accounts/login/'
SESSION_EXPIRE_AT_BROWSER_CLOSE False
TIME_FORMAT 'P'
SPH_MATCH_ALL 0
AUTH_USER_MODEL 'ponyFiction.Author'
DATE_INPUT_FORMATS ('%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y')
SPHINX_CONFIG {'cutoff': 1000,
'excerpts_opts': {'around': 10,
'chunk_separator': '\xe2\x80\xa6',
'html_strip_mode': 'strip',
'limit': 2048},
'match_mode': 0,
'max': 1000,
'number': 10,
'rank_mode': 7,
'retries_count': 5,
'retries_delay': 1,
'server': '/tmp/sphinx.socket',
'timeout': 10,
'weights_chapters': {'notes': 25, 'text': 100, 'title': 50},
'weights_stories': {'notes': 25,
'summary': 50,
'title': 100,
'username': 150}}
AUTHENTICATION_BACKENDS ('ponyFiction.auth_backends.AuthorModelBackend',)
EMAIL_HOST_PASSWORD u'********************'
PASSWORD_RESET_TIMEOUT_DAYS u'********************'
CACHE_MIDDLEWARE_ALIAS 'default'
SESSION_SAVE_EVERY_REQUEST False
NUMBER_GROUPING 0
SESSION_ENGINE 'django.contrib.sessions.backends.db'
CHAPTERS_COUNT {'main': 10, 'page': 10, 'stream': 20}
CSRF_FAILURE_VIEW 'django.views.csrf.csrf_failure'
CSRF_COOKIE_PATH '/'
LOGIN_REDIRECT_URL '/accounts/profile/'
DECIMAL_SEPARATOR '.'
IGNORABLE_404_URLS ()
LOCALE_PATHS ()
TEMPLATE_STRING_IF_INVALID ''
STORY_DOWNLOAD_FORMATS <reversed object at 0x1087850>
LOGOUT_URL '/accounts/logout/'
EMAIL_USE_TLS False
FIXTURE_DIRS ()
EMAIL_HOST 'localhost'
DATE_FORMAT 'N j, Y'
MEDIA_ROOT './ponyFiction/downloads'
DEFAULT_EXCEPTION_REPORTER_FILTER 'django.views.debug.SafeExceptionReporterFilter'
ADMINS ()
FORMAT_MODULE_PATH None
DEFAULT_FROM_EMAIL 'noreply@stories.everypony.ru'
MEDIA_URL '/downloads/'
DATETIME_FORMAT 'N j, Y, P'
TEMPLATE_DIRS ('./ponyFiction/templates',)
SITE_ID 1
DISALLOWED_USER_AGENTS ()
ALLOWED_INCLUDE_ROOTS ()
LOGGING {'disable_existing_loggers': False,
'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}},
'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',
'filters': ['require_debug_false'],
'level': 'ERROR'}},
'loggers': {'django.request': {'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True}},
'version': 1}
SHORT_DATE_FORMAT 'm/d/Y'
SECURE_PROXY_SSL_HEADER None
TEST_RUNNER 'django.test.simple.DjangoTestSuiteRunner'
CACHE_MIDDLEWARE_KEY_PREFIX u'********************'
TIME_ZONE 'Europe/Moscow'
FILE_UPLOAD_MAX_MEMORY_SIZE 2621440
EMAIL_BACKEND 'django.core.mail.backends.smtp.EmailBackend'
DEFAULT_TABLESPACE ''
TEMPLATE_CONTEXT_PROCESSORS ('django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages')
SESSION_COOKIE_AGE 1209600
COMPRESS_HTML True
USE_ETAGS False
LANGUAGES_BIDI ('he', 'ar', 'fa')
FILE_UPLOAD_TEMP_DIR None
INTERNAL_IPS ('127.0.0.1',)
DEFAULT_CHARSET 'utf-8'
EMAIL_PORT 25
USE_TZ False
SHORT_DATETIME_FORMAT 'm/d/Y P'
PASSWORD_HASHERS u'********************'
ABSOLUTE_URL_OVERRIDES {}
SPH_RANK_SPH04 7
CACHE_MIDDLEWARE_SECONDS 600
DEBUG_TOOLBAR_CONFIG {'INTERCEPT_REDIRECTS': False}
ALLOWED_TAGS ['b',
'i',
'strong',
'em',
's',
'u',
'p',
'br',
'hr',
'a',
'ul',
'ol',
'li',
'blockquote',
'sup',
'sub',
'pre',
'small',
'tt']
DATETIME_INPUT_FORMATS ('%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%Y-%m-%d',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%Y',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M',
'%m/%d/%y')
ADMIN_FOR ()
RSS {'chapters': 20, 'comments': 100, 'stories': 20}
EMAIL_HOST_USER ''
PROFANITIES_LIST u'********************'
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page.