IndexError at /blog/carta-de-conducao-pela-internet-a-partir-de-janeiro/

list index out of range
Request Method: GET
Request URL: https://www.testesdecodigogratis.com/blog/carta-de-conducao-pela-internet-a-partir-de-janeiro/
Django Version: 1.7.1
Exception Type: IndexError
Exception Value:
list index out of range
Exception Location: /home/tcg/website/tcg/main/templatetags/short_urls.py in trim_url, line 52
Python Executable: /home/tcg/website/bin/uwsgi
Python Version: 2.7.5
Python Path:
['.',
 '/home/tcg/website/tcg',
 '',
 '/home/tcg/website/lib64/python27.zip',
 '/home/tcg/website/lib64/python2.7',
 '/home/tcg/website/lib64/python2.7/plat-linux2',
 '/home/tcg/website/lib64/python2.7/lib-tk',
 '/home/tcg/website/lib64/python2.7/lib-old',
 '/home/tcg/website/lib64/python2.7/lib-dynload',
 '/usr/lib64/python2.7',
 '/usr/lib/python2.7',
 '/home/tcg/website/lib/python2.7/site-packages']
Server time: Ter, 19 Mar 2024 04:06:06 +0000

Error during template rendering

In template /home/tcg/website/tcg/theme/templates/generic/includes/comment.html, error at line 39

list index out of range

29 <div class="media-body">
30 <article itemprop="comment" itemscope itemtype="http://schema.org/UserComments">
31 <h5 class="media-heading comment-author" itemprop="creator" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ comment.user_name }}</span></h5>
32
33 <div class="comment-date"><span class="fa fa-clock-o"></span> <time itemprop="commentTime" datetime="{{ comment.submit_date|date:"c" }}">{% blocktrans with sometime=comment.submit_date|timesince %}{{ sometime }} atrás{% endblocktrans %}</time></div>
34
35 {% if comment.is_public %}
36 {% if comment.user.userprofile.instrutor or comment.user.is_staff %}
37 <p class="comment-text" itemprop="commentText">{{ comment.comment|safe|comment_filter }}</p>
38 {% else %}
39 <p class="comment-text" itemprop="commentText">{{ comment.comment|short_urls|comment_filter }}</p>
40 {% endif %}
41
42 <div class="comment-actions">
43 <a class="btn btn-xs btn-default comment-reply" href="#reply-{{ comment.id }}">
44 <span class="fa fa-reply"></span> {% trans "Reply" %}
45 </a>
46 <a class="btn btn-xs btn-default comment-link" href="{{ request.path }}#comment-{{ comment.id }}">
47 <span class="fa fa-link"></span> {% trans "Link" %}
48 </a>
49 {% if request.user.is_superuser %}

Traceback Switch to copy-and-paste view



Request information

GET

No GET data

POST

No POST data

FILES

No FILES data

No cookie data

META

Variable Value
wsgi.multiprocess
True
SCRIPT_NAME
u''
REQUEST_METHOD
'GET'
PATH_INFO
u'/blog/carta-de-conducao-pela-internet-a-partir-de-janeiro/'
SERVER_PROTOCOL
'HTTP/1.1'
QUERY_STRING
''
CONTENT_LENGTH
''
HTTP_USER_AGENT
'claudebot'
SERVER_NAME
'www.testesdecodigogratis.com'
REMOTE_ADDR
'54.84.65.73'
wsgi.url_scheme
'https'
SERVER_PORT
'443'
uwsgi.node
'apollo'
DOCUMENT_ROOT
'/usr/share/nginx/html'
wsgi.input
<uwsgi._Input object at 0x7f763185d1b0>
HTTP_HOST
'www.testesdecodigogratis.com'
HTTPS
'on'
wsgi.multithread
False
REQUEST_URI
'/blog/carta-de-conducao-pela-internet-a-partir-de-janeiro/'
HTTP_ACCEPT
'*/*'
wsgi.version
(1, 0)
wsgi.run_once
False
wsgi.errors
<open file 'wsgi_errors', mode 'w' at 0x7f7632a189c0>
REMOTE_PORT
'40682'
REQUEST_SCHEME
'https'
uwsgi.version
'2.0.11.1'
CONTENT_TYPE
''
wsgi.file_wrapper
''
CSRF_COOKIE
u'8Pmqo8hWUDTOZH3lnuURdz3IAscMtaTY'

Settings

Using settings module tcg.settings

Setting Value
TESTING
False
DEBUG_TOOLBAR_PANELS
[u'debug_toolbar.panels.versions.VersionsPanel',
 u'debug_toolbar.panels.timer.TimerPanel',
 u'debug_toolbar.panels.settings.SettingsPanel',
 u'debug_toolbar.panels.headers.HeadersPanel',
 u'debug_toolbar.panels.request.RequestPanel',
 u'debug_toolbar.panels.sql.SQLPanel',
 u'debug_toolbar.panels.staticfiles.StaticFilesPanel',
 u'debug_toolbar.panels.templates.TemplatesPanel',
 u'debug_toolbar.panels.cache.CachePanel',
 u'debug_toolbar.panels.signals.SignalsPanel',
 u'debug_toolbar.panels.logging.LoggingPanel',
 u'debug_toolbar.panels.redirects.RedirectsPanel',
 u'template_timings_panel.panels.TemplateTimings.TemplateTimings',
 u'template_profiler_panel.panels.template.TemplateProfilerPanel']
SERVER_EMAIL
'root@localhost'
ACCOUNT_USER_DISPLAY
<function <lambda> at 0x7f7635918578>
DEV_SERVER
False
TIME_ZONE
u'Europe/Lisbon'
ACCOUNT_AUTHENTICATION_METHOD
u'email'
CSRF_COOKIE_SECURE
True
SENDGRID_SANDBOX_MODE_IN_DEBUG
False
LANGUAGE_CODE
u'pt'
ROOT_URLCONF
u'tcg.urls'
MANAGERS
()
TEST_NON_SERIALIZED_APPS
[]
DEFAULT_CHARSET
'utf-8'
SESSION_SERIALIZER
'django.contrib.sessions.serializers.JSONSerializer'
ACCOUNT_EMAIL_REQUIRED
True
USE_THOUSAND_SEPARATOR
False
STATICSITEMAPS_ROOT_DIR
u'/home/tcg/website/tcg/static'
ALLOWED_HOSTS
[u'.testesdecodigogratis.com']
MESSAGE_STORAGE
u'django.contrib.messages.storage.cookie.CookieStorage'
WEBSOCKET_URL
u'/ws/'
EMAIL_SUBJECT_PREFIX
u''
SEND_BROKEN_LINK_EMAILS
False
STATICFILES_FINDERS
(u'django.contrib.staticfiles.finders.FileSystemFinder',
 u'django.contrib.staticfiles.finders.AppDirectoriesFinder')
SESSION_CACHE_ALIAS
'default'
DASHBOARD_TAGS
((u'mezzanine_tags.app_list', u'mezzanine_tags.recent_actions'),
 (u'comment_tags.recent_comments', u'testemunhos_tags.testemunhos_recentes'))
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_NAME
'sessionid'
PACKAGE_NAME_GRAPPELLI
u'grappelli_safe'
ADMIN_FOR
()
TIME_INPUT_FORMATS
('%H:%M:%S', '%H:%M:%S.%f', '%H:%M')
ACCOUNT_CONFIRM_EMAIL_ON_GET
True
DATABASES
{u'default': {'ATOMIC_REQUESTS': False,
              'AUTOCOMMIT': True,
              'CONN_MAX_AGE': 0,
              u'ENGINE': u'django.db.backends.mysql',
              u'HOST': u'127.0.0.1',
              u'NAME': u'tcg',
              'OPTIONS': {},
              u'PASSWORD': u'********************',
              u'PORT': u'3306',
              'TEST': {'CHARSET': None,
                       u'COLLATION': u'utf8_general_ci',
                       'MIRROR': None,
                       'NAME': None},
              'TIME_ZONE': 'UTC',
              u'USER': u'tcg'}}
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
SLUGIFY
u'lib.utils.unicode_slugify'
FILE_UPLOAD_PERMISSIONS
420
FILE_UPLOAD_HANDLERS
('django.core.files.uploadhandler.MemoryFileUploadHandler',
 'django.core.files.uploadhandler.TemporaryFileUploadHandler')
TEMPLATE_CONTEXT_PROCESSORS
(u'django.contrib.auth.context_processors.auth',
 u'django.contrib.messages.context_processors.messages',
 u'django.core.context_processors.debug',
 u'django.core.context_processors.i18n',
 u'django.core.context_processors.static',
 u'django.core.context_processors.media',
 u'django.core.context_processors.request',
 u'django.core.context_processors.tz',
 u'mezzanine.conf.context_processors.settings',
 u'mezzanine.pages.context_processors.page',
 u'ws4redis.context_processors.default',
 u'main.context_processors.project_context')
DEFAULT_CONTENT_TYPE
'text/html'
SOCIALACCOUNT_PROVIDERS
{u'facebook': {u'LOCALE_FUNC': <function <lambda> at 0x7f76359185f0>,
               u'METHOD': u'oauth2',
               u'SCOPE': [u'email', u'user_location'],
               u'VERIFIED_EMAIL': True,
               u'VERSION': u'v2.2'}}
RAYGUN_API_ENABLED
u'********************'
ACCOUNT_EMAIL_VERIFICATION
u'mandatory'
APPEND_SLASH
True
FIRST_DAY_OF_WEEK
0
DATABASE_ROUTERS
[]
DEFAULT_TABLESPACE
''
YEAR_MONTH_FORMAT
'F Y'
STATICFILES_STORAGE
'django.contrib.staticfiles.storage.StaticFilesStorage'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.dummy.DummyCache'}}
SU_REDIRECT_LOGIN
u'/conta/testes/'
RAYGUN_REPORT_ON_EXCEPTHOOK
True
SESSION_COOKIE_PATH
'/'
ACCOUNT_ADAPTER
u'utilizadores.adapter.AccountAdapter'
SILENCED_SYSTEM_CHECKS
[]
MIDDLEWARE_CLASSES
(u'django.middleware.common.BrokenLinkEmailsMiddleware',
 u'htmlmin.middleware.HtmlMinifyMiddleware',
 u'django.contrib.sessions.middleware.SessionMiddleware',
 u'django.middleware.locale.LocaleMiddleware',
 u'django.contrib.auth.middleware.AuthenticationMiddleware',
 u'django.middleware.common.CommonMiddleware',
 u'django.middleware.csrf.CsrfViewMiddleware',
 u'django.contrib.messages.middleware.MessageMiddleware',
 u'mezzanine.core.request.CurrentRequestMiddleware',
 u'mezzanine.core.middleware.RedirectFallbackMiddleware',
 u'mezzanine.core.middleware.TemplateForDeviceMiddleware',
 u'mezzanine.core.middleware.TemplateForHostMiddleware',
 u'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
 u'mezzanine.core.middleware.SitePermissionMiddleware',
 u'mezzanine.pages.middleware.PageMiddleware',
 u'htmlmin.middleware.MarkRequestMiddleware',
 u'utilizadores.middleware.SetLastVisitMiddleware')
USE_I18N
True
THOUSAND_SEPARATOR
','
SECRET_KEY
u'********************'
LANGUAGE_COOKIE_NAME
'django_language'
FILE_UPLOAD_TEMP_DIR
None
ACCOUNT_SIGNUP_FORM_CLASS
u'utilizadores.forms.SignupForm'
TRANSACTIONS_MANAGED
False
LOGGING_CONFIG
'logging.config.dictConfig'
TEMPLATE_LOADERS
(u'django.template.loaders.filesystem.Loader',
 u'django.template.loaders.app_directories.Loader')
WSGI_APPLICATION
None
TEMPLATE_DEBUG
True
X_FRAME_OPTIONS
'SAMEORIGIN'
CSRF_COOKIE_NAME
'csrftoken'
FORCE_SCRIPT_NAME
None
USE_X_FORWARDED_HOST
False
KEEP_COMMENTS_ON_MINIFYING
False
SIGNING_BACKEND
'django.core.signing.TimestampSigner'
SESSION_COOKIE_SECURE
True
PROJECT_DIRNAME
'tcg'
USE_SOUTH
True
CSRF_COOKIE_DOMAIN
None
FILE_CHARSET
'utf-8'
DEBUG
True
COMMENTS_APP
u'mezzanine.generic'
INTERNAL_IPS
(u'127.0.0.1',)
DEFAULT_FILE_STORAGE
'django.core.files.storage.FileSystemStorage'
INSTALLED_APPS
(u'mezzanine.boot',
 u'django.contrib.auth',
 u'django.contrib.contenttypes',
 u'django.contrib.redirects',
 u'django.contrib.sessions',
 u'django.contrib.sites',
 u'django.contrib.sitemaps',
 u'django.contrib.humanize',
 u'rest_framework',
 u'rest_framework.authtoken',
 u'ajax_select',
 u'main',
 u'testemunhos',
 u'testes',
 u'escolas',
 u'material_estudo',
 u'api',
 u'theme',
 u'mezzanine_blocks',
 u'sorl.thumbnail',
 u'django_extensions',
 u'mptt',
 u'django_su',
 u'static_sitemaps',
 u'adminsortable2',
 u'ws4redis',
 u'allauth',
 u'allauth.account',
 u'allauth.socialaccount',
 u'allauth.socialaccount.providers.facebook',
 u'utilizadores',
 u'mezzanine.conf',
 u'mezzanine.core',
 u'mezzanine.generic',
 u'mezzanine.blog',
 u'mezzanine.forms',
 u'mezzanine.pages',
 u'filebrowser_safe',
 u'grappelli_safe',
 u'django.contrib.admin',
 u'django.contrib.staticfiles',
 u'django_comments')
LANGUAGES
((u'pt', u'Portuguese'),)
USE_L10N
False
COMMENTS_ALLOW_PROFANITIES
False
STATIC_ROOT
u'/home/tcg/website/tcg/static'
STATICFILES_DIRS
()
PREPEND_WWW
False
SECURE_PROXY_SSL_HEADER
None
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
LANGUAGE_COOKIE_AGE
None
RAYGUN_API_KEY
u'********************'
DEBUG_PROPAGATE_EXCEPTIONS
False
DISPOSABLE_EMAIL_DOMAINS
u'/home/tcg/website/tcg/disposable-email-domains.txt'
MEDIA_URL
u'/media/'
MONTH_DAY_FORMAT
'F j'
LOGIN_URL
u'/conta/login/'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
TIME_FORMAT
'P'
BUILD_VERSION
'08647f6'
AUTH_USER_MODEL
'auth.User'
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')
AUTHENTICATION_BACKENDS
(u'mezzanine.core.auth_backends.MezzanineBackend',
 u'allauth.account.auth_backends.AuthenticationBackend',
 u'django_su.backends.SuBackend')
EMAIL_HOST_PASSWORD
u'********************'
PACKAGE_NAME_FILEBROWSER
u'filebrowser_safe'
AUTH_PROFILE_MODULE
u'utilizadores.UserProfile'
LANGUAGE_COOKIE_DOMAIN
None
CACHE_MIDDLEWARE_ALIAS
'default'
SESSION_SAVE_EVERY_REQUEST
False
NUMBER_GROUPING
0
SESSION_ENGINE
'django.contrib.sessions.backends.db'
SOCIALACCOUNT_EMAIL_REQUIRED
True
CSRF_FAILURE_VIEW
'django.views.csrf.csrf_failure'
CSRF_COOKIE_PATH
'/'
GRAPPELLI_INSTALLED
True
ABSOLUTE_URL_OVERRIDES
{}
PROJECT_ROOT
'/home/tcg/website/tcg'
ACCOUNT_LOGOUT_ON_GET
True
DECIMAL_SEPARATOR
'.'
IGNORABLE_404_URLS
()
ACCOUNT_FORMS
{u'login': u'utilizadores.forms.CustomLoginForm'}
LOCALE_PATHS
[u'/home/tcg/website/tcg/locale']
TEMPLATE_STRING_IF_INVALID
''
SOCIALACCOUNT_QUERY_EMAIL
True
SESSION_FILE_PATH
None
LOGOUT_URL
'/accounts/logout/'
EMAIL_USE_TLS
False
LOGIN_REDIRECT_URL
u'/conta/testes/'
FIXTURE_DIRS
()
EMAIL_HOST
'localhost'
DATE_FORMAT
'N j, Y'
SOCIALACCOUNT_AUTO_SIGNUP
False
OPTIONAL_APPS
(u'django_extensions', u'filebrowser_safe', u'grappelli_safe')
MEDIA_ROOT
u'/home/tcg/website/tcg/media'
DEFAULT_EXCEPTION_REPORTER_FILTER
'django.views.debug.SafeExceptionReporterFilter'
ADMINS
()
FORMAT_MODULE_PATH
None
DEFAULT_FROM_EMAIL
u'Testes de C\xf3digo Gr\xe1tis <geral@testesdecodigogratis.com>'
REST_FRAMEWORK
{u'DEFAULT_AUTHENTICATION_CLASSES': (u'rest_framework.authentication.BasicAuthentication',
                                     u'rest_framework.authentication.SessionAuthentication',
                                     u'rest_framework.authentication.TokenAuthentication'),
 u'DEFAULT_PAGINATION_CLASS': u'rest_framework.pagination.PageNumberPagination',
 u'PAGE_SIZE': 20}
EXCLUDE_FROM_MINIFYING
(u'^rating/',
 u'^gerir/',
 u'^admin_keywords_submit/',
 u'^add/',
 u'^adminsortable2_update/',
 u'^ajax_select/')
STATICSITEMAPS_ROOT_SITEMAP
u'main.sitemaps.sitemaps'
HTML_MINIFY
True
DATETIME_FORMAT
'N j, Y, P'
TEMPLATE_DIRS
(u'/home/tcg/website/tcg/templates',)
SITE_ID
1
DISALLOWED_USER_AGENTS
()
ALLOWED_INCLUDE_ROOTS
()
SENDGRID_API_KEY
u'********************'
EMAIL_PORT
25
WS4REDIS_CONNECTION
{u'host': u'localhost'}
LOGGING
{}
SHORT_DATE_FORMAT
'm/d/Y'
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
SECURE_SSL_REDIRECT
True
THUMBNAIL_FORMAT
u'PNG'
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
EMAIL_BACKEND
u'sendgrid_backend.SendgridBackend'
BLOG_USE_FEATURED_IMAGE
True
EMAIL_USE_SSL
False
SESSION_COOKIE_HTTPONLY
True
MIGRATION_MODULES
{}
SESSION_COOKIE_AGE
1209600
SETTINGS_MODULE
u'tcg.settings'
NEVERCACHE_KEY
u'********************'
USE_ETAGS
False
LANGUAGES_BIDI
('he', 'ar', 'fa', 'ur')
DEFAULT_INDEX_TABLESPACE
''
CSRF_COOKIE_AGE
31449600
STATIC_URL
u'/static/'
ACCOUNT_USERNAME_REQUIRED
False
ADMIN_MENU_ORDER
((u'Content',
  ((u'Blog', u'blog.BlogPost'),
   (u'Escolas', u'escolas.Escola'),
   (u'Mensagens para Escolas', u'escolas.Mensagem'),
   (u'Testemunhos', u'testemunhos.Testemunho'),
   (u'Material de Estudo', u'material_estudo.MaterialEstudo'),
   (u'Coment\xe1rios', u'generic.ThreadedComment'),
   (u'P\xe1ginas', u'pages.Page'))),
 (u'Outro Conte\xfado',
  (u'mezzanine_blocks.Block',
   u'mezzanine_blocks.RichBlock',
   u'mezzanine_blocks.ImageBlock',
   u'blog.BlogCategory',
   (u'Categorias Material de Estudo', u'material_estudo.Categoria'),
   (u'Media Library', u'fb_browse'),
   u'main.Concelho')),
 (u'Settings', (u'sites.Site', u'redirects.Redirect', u'conf.Setting')),
 (u'Users',
  (u'auth.User',
   u'auth.Group',
   u'utilizadores.UserProfile',
   u'account.EmailConfirmation',
   u'account.EmailAddress',
   u'socialaccount.SocialApp',
   u'socialaccount.SocialToken',
   u'socialaccount.SocialAccount')))
USE_TZ
True
SHORT_DATETIME_FORMAT
'm/d/Y P'
PASSWORD_HASHERS
u'********************'
FABRIC
{u'ADMIN_PASS': u'********************',
 u'DB_PASS': u'********************',
 u'DOMAINS': [u'.testesdecodigogratis.com'],
 u'GUNICORN_PORT': 8000,
 u'HOSTS': [u'.testesdecodigogratis.com'],
 u'LOCALE': u'pt_PT.UTF-8',
 u'NEVERCACHE_KEY': u'********************',
 u'PROJECT_NAME': u'tcg',
 u'REPO_URL': u'ssh://bitbucket.org:jrfernandes/tcg.git',
 u'REQUIREMENTS_PATH': u'requirements.txt',
 u'SECRET_KEY': u'********************',
 u'SSH_KEY_PATH': u'********************',
 u'SSH_USER': u'tcg',
 u'VIRTUALENV_HOME': u'/home/tcg/website'}
STATICSITEMAPS_URL
u'https://www.testesdecodigogratis.com/static/'
LANGUAGE_COOKIE_PATH
'/'
WS4REDIS_ALLOWED_CHANNELS
u'escolas.views.get_allowed_channels'
CACHE_MIDDLEWARE_SECONDS
600
ACCOUNT_SIGNUP_PASSWORD_VERIFICATION
u'********************'
CSRF_COOKIE_HTTPONLY
False
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')
APP_VERSION
u'2.1.0'
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.