'NoneType' object has no attribute 'name'
Request Method: | GET |
---|---|
Request URL: | https://sinbiota.biota.org.br/occurrence/20323/ |
Django Version: | 1.4.3 |
Exception Type: | AttributeError |
Exception Value: | 'NoneType' object has no attribute 'name' |
Exception Location: | /django/sinbiota/SinbiotaGeoDjango/taxonomy/models.py in display_name, line 26 |
Python Executable: | /django/py2/bin/python |
Python Version: | 2.7.18 |
Python Path: | ['/django/sinbiota/SinbiotaGeoDjango', '/django/py2/bin', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/django/py2/lib/python2.7/site-packages'] |
Server time: | Thu, 28 Mar 2024 09:51:02 +0000 |
/django/py2/lib/python2.7/site-packages/django/core/handlers/base.py
in get_response
for middleware_method in self._view_middleware:
response = middleware_method(request, callback, callback_args, callback_kwargs)
if response:
break
if response is None:
try:
response = callback(request, *callback_args, **callback_kwargs)...
except Exception, e:
# If the view raised an exception, run it through exception
# middleware, and if the exception middleware returns a
# response, use that. Otherwise, reraise the exception.
for middleware_method in self._exception_middleware:
response = middleware_method(request, e)
Variable | Value |
---|---|
exceptions | <module 'django.core.exceptions' from '/django/py2/lib/python2.7/site-packages/django/core/exceptions.pyc'> |
e | AttributeError("'NoneType' object has no attribute 'name'",) |
callback_args | () |
settings | <django.conf.LazySettings object at 0x7f480881c4d0> |
middleware_method | <bound method MessageMiddleware.process_request of <django.contrib.messages.middleware.MessageMiddleware object at 0x7f48086856d0>> |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f480905acd0> |
request | "<WSGIRequest\npath:/occurrence/20323/,\nGET:<QueryDict: {}>,\nPOST:<QueryDict: {}>,\nCOOKIES:{},\nMETA:{'HTTP_ACCEPT': '*/*',\n 'HTTP_CONNECTION': 'close',\n 'HTTP_HOST': 'sinbiota.biota.org.br',\n 'HTTP_USER_AGENT': 'claudebot',\n 'HTTP_X_FORWARDED_FOR': '54.197.64.207, 10.1.182.198',\n 'HTTP_X_FORWARDED_HOST': 'sinbiota.biota.org.br',\n 'HTTP_X_FORWARDED_PORT': '443',\n 'HTTP_X_FORWARDED_PROTO': 'https',\n 'HTTP_X_FORWARDED_SCHEME': 'https',\n 'HTTP_X_REAL_IP': '54.197.64.207',\n 'HTTP_X_REQUEST_ID': 'c36250ed3ae557a365f23c624edc3a10',\n 'HTTP_X_SCHEME': 'https',\n 'PATH_INFO': u'/occurrence/20323/',\n 'QUERY_STRING': '',\n 'RAW_URI': '/occurrence/20323/',\n 'REMOTE_ADDR': '127.0.0.1',\n 'REMOTE_PORT': '39878',\n 'REQUEST_METHOD': 'GET',\n 'SCRIPT_NAME': u'',\n 'SERVER_NAME': '0.0.0.0',\n 'SERVER_PORT': '8000',\n 'SERVER_PROTOCOL': 'HTTP/1.0',\n 'SERVER_SOFTWARE': 'gunicorn/19.10.0',\n 'gunicorn.socket': <socket._socketobject object at 0x7f48029989f0>,\n 'wsgi.errors': <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f4802710490>,\n 'wsgi.file_wrapper': <class 'gunicorn.http.wsgi.FileWrapper'>,\n 'wsgi.input': <gunicorn.http.body.Body object at 0x7f4802710610>,\n 'wsgi.input_terminated': True,\n 'wsgi.multiprocess': False,\n 'wsgi.multithread': False,\n 'wsgi.run_once': False,\n 'wsgi.url_scheme': 'https',\n 'wsgi.version': (1, 0)}>" |
callback | <function occurrence_details at 0x7f4802b7fed0> |
resolver | <RegexURLResolver SinbiotaGeoDjango.urls (None:None) ^/> |
urlresolvers | <module 'django.core.urlresolvers' from '/django/py2/lib/python2.7/site-packages/django/core/urlresolvers.pyc'> |
callback_kwargs | {'pk': u'20323'} |
response | None |
urlconf | 'SinbiotaGeoDjango.urls' |
/django/sinbiota/SinbiotaGeoDjango/sinbiota/views.py
in occurrence_details
def occurrence_details(request, pk):
occurrence = get_object_or_404(Occurrence, pk=pk)
point_coordinates = "%f,%f" % (occurrence.location.location_point.point.coords[1], occurrence.location.location_point.point.coords[0])
taxonomic_groups = set([x[0] for x in occurrence.specimen_set.all().values_list('taxonomic_classification__legacy_taxonomic_group__name')])
sp_list = specimen_model_list(occurrence)...
specimen_list_json = simplejson.dumps(sp_list)
taxon_tree_code = taxon_tree_html(taxon_tree(sp_list), False)
count_occurrences = sum([1 if s.number_of_individuals is None else s.number_of_individuals
for s in occurrence.specimen_set.all()])
return render(request, 'environmental/occurrence/details.html', {
Variable | Value |
---|---|
occurrence | <Occurrence: 20323> |
taxonomic_groups | set([u'Algae']) |
request | "<WSGIRequest\npath:/occurrence/20323/,\nGET:<QueryDict: {}>,\nPOST:<QueryDict: {}>,\nCOOKIES:{},\nMETA:{'HTTP_ACCEPT': '*/*',\n 'HTTP_CONNECTION': 'close',\n 'HTTP_HOST': 'sinbiota.biota.org.br',\n 'HTTP_USER_AGENT': 'claudebot',\n 'HTTP_X_FORWARDED_FOR': '54.197.64.207, 10.1.182.198',\n 'HTTP_X_FORWARDED_HOST': 'sinbiota.biota.org.br',\n 'HTTP_X_FORWARDED_PORT': '443',\n 'HTTP_X_FORWARDED_PROTO': 'https',\n 'HTTP_X_FORWARDED_SCHEME': 'https',\n 'HTTP_X_REAL_IP': '54.197.64.207',\n 'HTTP_X_REQUEST_ID': 'c36250ed3ae557a365f23c624edc3a10',\n 'HTTP_X_SCHEME': 'https',\n 'PATH_INFO': u'/occurrence/20323/',\n 'QUERY_STRING': '',\n 'RAW_URI': '/occurrence/20323/',\n 'REMOTE_ADDR': '127.0.0.1',\n 'REMOTE_PORT': '39878',\n 'REQUEST_METHOD': 'GET',\n 'SCRIPT_NAME': u'',\n 'SERVER_NAME': '0.0.0.0',\n 'SERVER_PORT': '8000',\n 'SERVER_PROTOCOL': 'HTTP/1.0',\n 'SERVER_SOFTWARE': 'gunicorn/19.10.0',\n 'gunicorn.socket': <socket._socketobject object at 0x7f48029989f0>,\n 'wsgi.errors': <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f4802710490>,\n 'wsgi.file_wrapper': <class 'gunicorn.http.wsgi.FileWrapper'>,\n 'wsgi.input': <gunicorn.http.body.Body object at 0x7f4802710610>,\n 'wsgi.input_terminated': True,\n 'wsgi.multiprocess': False,\n 'wsgi.multithread': False,\n 'wsgi.run_once': False,\n 'wsgi.url_scheme': 'https',\n 'wsgi.version': (1, 0)}>" |
point_coordinates | '-20.922800,-50.342499' |
x | (u'Algae',) |
pk | u'20323' |
/django/sinbiota/SinbiotaGeoDjango/sinbiota/business/specimen_list.py
in specimen_model_list
try:
self.legacy_taxonomic_classification = sp.taxonomic_classification.legacy_classification_tuplets()
except:
self.legacy_taxonomic_classification = ""
def specimen_model_list(occurrence):
return [SpecimenModel(sp).__dict__ for sp in occurrence.specimen_set.all()]...
class TaxonTreeNode():
def __init__(self, id, name, rank, parent = None):
self.id = id
self.name = name
Variable | Value |
---|---|
sp | <Specimen: Specimen object> |
occurrence | <Occurrence: 20323> |
/django/sinbiota/SinbiotaGeoDjango/sinbiota/business/specimen_list.py
in __init__
# -*- coding: utf-8 -*-
__author__ = 'pedro'
class SpecimenModel():
def __init__(self,sp):
self.id = sp.id
self.taxonomic_classification = sp.taxonomic_classification.taxon.scientific_name()...
self.taxonomic_classification_id = sp.taxonomic_classification_id
self.taxon_id = sp.taxonomic_classification.taxon_id
ancestors = sp.taxonomic_classification.taxon.ancestors()
self.full_taxonomic_classification = {x.rank: x.name for x in ancestors}
self.full_taxonomic_classification_array = [{'rank':x.rank, 'name':x.display_name(), 'id':x.id} for x in [sp.taxonomic_classification.taxon] + ancestors]
try:
Variable | Value |
---|---|
self | <sinbiota.business.specimen_list.SpecimenModel instance at 0x7f48022690a0> |
sp | <Specimen: Specimen object> |
/django/sinbiota/SinbiotaGeoDjango/taxonomy/models.py
in scientific_name
rank = models.CharField(max_length=64)
parent = models.ForeignKey('self', null=True, blank=True)
reference = models.ForeignKey(TaxonReference)
def scientific_name(self):
if 'genus' in self.rank:
return "%s sp." % self.name
return self.display_name()...
def display_name(self):
if 'species' in self.rank:
temp = self
sb = []
while True:
Variable | Value |
---|---|
self | Error in formatting: 'NoneType' object has no attribute 'name' |
/django/sinbiota/SinbiotaGeoDjango/taxonomy/models.py
in display_name
return self.display_name()
def display_name(self):
if 'species' in self.rank:
temp = self
sb = []
while True:
sb.append(temp.name)...
if "genus" in temp.rank:
break
temp = temp.parent
return string.join(reversed(sb))
return self.name
Variable | Value |
---|---|
sb | [u'floccosa', u'Microspora', u'Fungi'] |
self | Error in formatting: 'NoneType' object has no attribute 'name' |
temp | None |
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
SERVER_SOFTWARE | 'gunicorn/19.10.0' |
SCRIPT_NAME | u'' |
HTTP_X_FORWARDED_PORT | '443' |
wsgi.input_terminated | True |
SERVER_PROTOCOL | 'HTTP/1.0' |
QUERY_STRING | '' |
HTTP_X_REAL_IP | '54.197.64.207' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_CONNECTION | 'close' |
REMOTE_PORT | '39878' |
SERVER_NAME | '0.0.0.0' |
REMOTE_ADDR | '127.0.0.1' |
wsgi.url_scheme | 'https' |
SERVER_PORT | '8000' |
PATH_INFO | u'/occurrence/20323/' |
HTTP_ACCEPT | '*/*' |
HTTP_X_FORWARDED_PROTO | 'https' |
wsgi.input | <gunicorn.http.body.Body object at 0x7f4802710610> |
HTTP_HOST | 'sinbiota.biota.org.br' |
wsgi.multithread | False |
HTTP_X_SCHEME | 'https' |
wsgi.version | (1, 0) |
RAW_URI | '/occurrence/20323/' |
wsgi.run_once | False |
wsgi.errors | <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f4802710490> |
wsgi.multiprocess | False |
HTTP_X_FORWARDED_HOST | 'sinbiota.biota.org.br' |
gunicorn.socket | <socket._socketobject object at 0x7f48029989f0> |
REQUEST_METHOD | 'GET' |
HTTP_X_FORWARDED_FOR | '54.197.64.207, 10.1.182.198' |
wsgi.file_wrapper | '' |
HTTP_X_REQUEST_ID | 'c36250ed3ae557a365f23c624edc3a10' |
HTTP_X_FORWARDED_SCHEME | 'https' |
SinbiotaGeoDjango.settings
Setting | Value |
---|---|
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
CSRF_COOKIE_SECURE | False |
LANGUAGE_CODE | 'pt-br' |
ROOT_URLCONF | 'SinbiotaGeoDjango.urls' |
MANAGERS | (('Suporte Sinbiota', 'webmaster@biota.org.br'),) |
DEFAULT_CHARSET | 'utf-8' |
STATIC_ROOT | '/var/www/sinbiotageodjango/static' |
DAJAXICE_MEDIA_PREFIX | 'dajaxice' |
ALLOWED_HOSTS | ['*'] |
MESSAGE_STORAGE | 'django.contrib.messages.storage.fallback.FallbackStorage' |
EMAIL_SUBJECT_PREFIX | '[Django] ' |
FILE_UPLOAD_PERMISSIONS | None |
URL_VALIDATOR_USER_AGENT | 'Django/1.4.3 (https://www.djangoproject.com)' |
STATICFILES_FINDERS | ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder') |
SESSION_COOKIE_DOMAIN | None |
SESSION_COOKIE_NAME | 'sessionid' |
ADMIN_FOR | () |
TIME_INPUT_FORMATS | ('%H:%M:%S', '%H:%M') |
DATABASES | {'default': {'ENGINE': 'django.contrib.gis.db.backends.postgis', 'HOST': 'localhost', 'NAME': 'geosinbiota', 'OPTIONS': {}, 'PASSWORD': u'********************', 'PORT': '', 'TEST_CHARSET': None, 'TEST_COLLATION': None, 'TEST_MIRROR': None, 'TEST_NAME': None, 'TIME_ZONE': 'America/Sao_Paulo', 'USER': 'biota'}, 'legacy_sinbiota_db': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'HOST': 'localhost', 'NAME': 'sinbiota_legacy', 'OPTIONS': {}, 'PASSWORD': u'********************', 'PORT': '', 'TEST_CHARSET': None, 'TEST_COLLATION': None, 'TEST_MIRROR': None, 'TEST_NAME': None, 'TIME_ZONE': 'America/Sao_Paulo', 'USER': 'pedro'}} |
SERVER_EMAIL | 'mail.biota.org.br' |
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 | ['SinbiotaGeoDjango.database_routers.LegacySinbiotaRouter'] |
YEAR_MONTH_FORMAT | 'F Y' |
STATICFILES_STORAGE | 'django.contrib.staticfiles.storage.StaticFilesStorage' |
CACHES | {'default': {'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 'LOCATION': '/var/tmp/django_cache', 'OPTIONS': {'MAX_ENTRIES': 1000}, 'TIMEOUT': 600}} |
SESSION_COOKIE_PATH | '/' |
MIDDLEWARE_CLASSES | ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') |
USE_I18N | True |
THOUSAND_SEPARATOR | ',' |
SECRET_KEY | u'********************' |
LANGUAGE_COOKIE_NAME | 'django_language' |
DEFAULT_INDEX_TABLESPACE | '' |
TRANSACTIONS_MANAGED | False |
LOGGING_CONFIG | 'django.utils.log.dictConfig' |
SEND_BROKEN_LINK_EMAILS | False |
TEMPLATE_LOADERS | ('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', 'django.template.loaders.eggs.Loader') |
WSGI_APPLICATION | 'SinbiotaGeoDjango.wsgi.application' |
TEMPLATE_DEBUG | True |
X_FRAME_OPTIONS | 'SAMEORIGIN' |
AUTHENTICATION_BACKENDS | ('django.contrib.auth.backends.ModelBackend',) |
FORCE_SCRIPT_NAME | None |
USE_X_FORWARDED_HOST | False |
SIGNING_BACKEND | 'django.core.signing.TimestampSigner' |
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 | ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_admin_bootstrapped', 'django.contrib.admin', 'django.contrib.gis', 'django.contrib.admindocs', 'django.contrib.formtools', 'dajaxice', 'gis', 'sinbiota', 'legacy_sinbiota', 'taxonomy', 'clear_cache') |
LANGUAGES | (('pt-br', u'Portugu\xeas'), ('en', u'Ingl\xeas')) |
COMMENTS_ALLOW_PROFANITIES | False |
STATICFILES_DIRS | () |
PREPEND_WWW | False |
SECURE_PROXY_SSL_HEADER | None |
AUTH_PROFILE_MODULE | 'sinbiota.UserProfile' |
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' |
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') |
CSRF_COOKIE_NAME | 'csrftoken' |
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' |
CSRF_FAILURE_VIEW | 'django.views.csrf.csrf_failure' |
CSRF_COOKIE_PATH | '/' |
LOGIN_REDIRECT_URL | '/accounts/home' |
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'}}, 'version': 1} |
IGNORABLE_404_URLS | () |
LOCALE_PATHS | ('/home/mangelica/PyCharmProjects/SinbiotaGeoDjango/locale', '/django/sinbiota/SinbiotaGeoDjango/locale') |
SITE | 'https://sinbiota.biota.org.br' |
TEMPLATE_STRING_IF_INVALID | '' |
LOGOUT_URL | '/accounts/logout/' |
EMAIL_USE_TLS | True |
FIXTURE_DIRS | () |
EMAIL_HOST | 'mail' |
DATE_FORMAT | 'N j, Y' |
MEDIA_ROOT | '' |
DEFAULT_EXCEPTION_REPORTER_FILTER | 'django.views.debug.SafeExceptionReporterFilter' |
ADMINS | (('Suporte Sinbiota', 'webmaster@biota.org.br'),) |
FORMAT_MODULE_PATH | None |
DEFAULT_FROM_EMAIL | 'suporte@biota.org.br' |
EMAIL_SUPORTE | 'suporte@biota.org.br' |
MEDIA_URL | '' |
DATETIME_FORMAT | 'N j, Y, P' |
TEMPLATE_DIRS | ('/django/sinbiota/SinbiotaGeoDjango/SinbiotaGeoDjango/../templates',) |
SITE_ID | 2 |
DISALLOWED_USER_AGENTS | () |
ALLOWED_INCLUDE_ROOTS | () |
DECIMAL_SEPARATOR | '.' |
SHORT_DATE_FORMAT | 'm/d/Y' |
TEST_RUNNER | 'django.test.simple.DjangoTestSuiteRunner' |
CACHE_MIDDLEWARE_KEY_PREFIX | u'********************' |
TIME_ZONE | 'America/Sao_Paulo' |
FILE_UPLOAD_MAX_MEMORY_SIZE | 2621440 |
EMAIL_BACKEND | 'django.core.mail.backends.smtp.EmailBackend' |
DEFAULT_TABLESPACE | '' |
TEMPLATE_CONTEXT_PROCESSORS | ('django.core.context_processors.debug', 'django.core.context_processors.request', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages') |
SITE_NAME | 'Sinbiota 2.1' |
SESSION_COOKIE_AGE | 1209600 |
SETTINGS_MODULE | 'SinbiotaGeoDjango.settings' |
USE_ETAGS | False |
LANGUAGES_BIDI | ('he', 'ar', 'fa') |
FILE_UPLOAD_TEMP_DIR | None |
INTERNAL_IPS | () |
STATIC_URL | '/static/' |
EMAIL_PORT | 25 |
USE_TZ | False |
SHORT_DATETIME_FORMAT | 'm/d/Y P' |
PASSWORD_HASHERS | u'********************' |
ABSOLUTE_URL_OVERRIDES | {} |
CACHE_MIDDLEWARE_SECONDS | 600 |
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') |
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.