· 5 years ago · Jan 20, 2020, 11:24 PM
1SUCCESS: AttributeError at /candidates/47/countries/170/cities/
2'NoneType' object has no attribute 'id'
3
4Request Method: GET
5Request URL: http://95.213.252.8/candidates/47/countries/170/cities/?end=2020-01-20T23%3A59%3A59%2B0300&page=1&start=2019-08-01T00%3A00%3A00%2B0300
6Django Version: 2.2.9
7Python Executable: /root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/bin/python
8Python Version: 3.7.3
9Python Path: ['/app', '/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/bin', '/usr/local/lib/python37.zip', '/usr/local/lib/python3.7', '/usr/local/lib/python3.7/lib-dynload', '/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages', '/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/src/clickhouse-driver', '/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/src/pysendpulse', '/app']
10Server time: Mon, 20 Jan 2020 23:13:32 +0000
11Installed Applications:
12['django.contrib.auth',
13 'django.contrib.contenttypes',
14 'django.contrib.sessions',
15 'django.contrib.messages',
16 'django.contrib.staticfiles',
17 'django.contrib.admin',
18 'drf_yasg',
19 'rest_framework.authtoken',
20 'corsheaders',
21 'colorful',
22 'push_notifications',
23 'django_celery_beat',
24 'authorization',
25 'mentions',
26 'administration',
27 'app']
28Installed Middleware:
29['django.middleware.security.SecurityMiddleware',
30 'django.contrib.sessions.middleware.SessionMiddleware',
31 'corsheaders.middleware.CorsMiddleware',
32 'django.middleware.common.CommonMiddleware',
33 'django.middleware.csrf.CsrfViewMiddleware',
34 'django.contrib.auth.middleware.AuthenticationMiddleware',
35 'django.contrib.messages.middleware.MessageMiddleware',
36 'django.middleware.clickjacking.XFrameOptionsMiddleware']
37
38
39Traceback:
40
41File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
42 34. response = get_response(request)
43
44File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
45 115. response = self.process_exception_by_middleware(e, request)
46
47File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
48 113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
49
50File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
51 54. return view_func(*args, **kwargs)
52
53File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/django/views/generic/base.py" in view
54 71. return self.dispatch(request, *args, **kwargs)
55
56File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/rest_framework/views.py" in dispatch
57 505. response = self.handle_exception(exc)
58
59File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/rest_framework/views.py" in handle_exception
60 465. self.raise_uncaught_exception(exc)
61
62File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/rest_framework/views.py" in raise_uncaught_exception
63 476. raise exc
64
65File "/root/.cache/pypoetry/virtualenvs/rephouse-backend-9TtSrW0h-py3.7/lib/python3.7/site-packages/rest_framework/views.py" in dispatch
66 502. response = handler(request, *args, **kwargs)
67
68File "/app/mentions/views/__init__.py" in get
69 526. return super().get(*args, **kwargs)
70
71File "/app/rephouse_backend/views.py" in get
72 62. response_serializer = self.response_serializer_class(query=query)
73
74File "/app/rephouse_backend/views.py" in __init__
75 18. self.instance = self.query.query()
76
77File "/app/rephouse_backend/clickhouse/aggregations/queries/geo/queries.py" in query
78 133. ) for result in results]
79
80File "/app/rephouse_backend/clickhouse/aggregations/queries/geo/queries.py" in <listcomp>
81 133. ) for result in results]
82
83File "/app/rephouse_backend/clickhouse/aggregations/queries/geo/queries.py" in get_city_id
84 138. return City.objects.filter(ascii_name=name, country_code=self.country_code.upper()).order_by('id').first().id
85
86Exception Type: AttributeError at /candidates/47/countries/170/cities/
87Exception Value: 'NoneType' object has no attribute 'id'
88Request information:
89USER: 79170951655
90
91GET:
92end = '2020-01-20T23:59:59+0300'
93page = '1'
94start = '2019-08-01T00:00:00+0300'
95
96POST: No POST data
97
98FILES: No FILES data
99
100COOKIES: No cookie data
101
102META:
103HTTP_ACCEPT = '*/*'
104HTTP_ACCEPT_ENCODING = 'gzip;q=1.0, compress;q=0.5'
105HTTP_ACCEPT_LANGUAGE = 'ru;q=1.0'
106HTTP_AUTHORIZATION = 'Token 133a5403f8d5551de484c029e6dee90bccbbb6a3'
107HTTP_CONNECTION = 'close'
108HTTP_HOST = '95.213.252.8'
109HTTP_USER_AGENT = 'Reputation house/3.3 (forafontov.Reputation-house; build:2; iOS 13.3.0) Alamofire/4.8.2'
110HTTP_X_FORWARDED_FOR = '81.9.126.16'
111PATH_INFO = '/candidates/47/countries/170/cities/'
112QUERY_STRING = 'end=2020-01-20T23%3A59%3A59%2B0300&page=1&start=2019-08-01T00%3A00%3A00%2B0300'
113RAW_URI = '/candidates/47/countries/170/cities/?end=2020-01-20T23%3A59%3A59%2B0300&page=1&start=2019-08-01T00%3A00%3A00%2B0300'
114REMOTE_ADDR = '172.22.0.9'
115REMOTE_PORT = '56672'
116REQUEST_METHOD = 'GET'
117SCRIPT_NAME = ''
118SERVER_NAME = '0.0.0.0'
119SERVER_PORT = '8000'
120SERVER_PROTOCOL = 'HTTP/1.0'
121SERVER_SOFTWARE = 'gunicorn/19.10.0'
122gunicorn.socket = <gevent._socket3.socket object, fd=11, family=2, type=1, proto=6>
123wsgi.errors = <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f86ac528710>
124wsgi.file_wrapper = ''
125wsgi.input = <gunicorn.http.body.Body object at 0x7f86ac5115f8>
126wsgi.input_terminated = True
127wsgi.multiprocess = True
128wsgi.multithread = True
129wsgi.run_once = False
130wsgi.url_scheme = 'http'
131wsgi.version = '(1, 0)'
132
133Settings:
134Using settings module rephouse_backend.settings
135ABSOLUTE_URL_OVERRIDES = {}
136ADMINS = []
137ADMIN_PASSWORD = '********************'
138ADMIN_USERNAME = 'mainAdmin2019'
139ALLOWED_HOSTS = ['95.213.252.8', '95.213.195.171', '95.213.252.8', 'localhost']
140APPEND_SLASH = True
141AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']
142AUTH_PASSWORD_VALIDATORS = '********************'
143AUTH_USER_MODEL = 'auth.User'
144BASE_DIR = '/app'
145CACHES = {'default': {'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 'LOCATION': '/tmp/django_cache'}}
146CACHE_MIDDLEWARE_ALIAS = 'default'
147CACHE_MIDDLEWARE_KEY_PREFIX = '********************'
148CACHE_MIDDLEWARE_SECONDS = 600
149CELERYBEAT_SCHEDULER = 'django_celery_beat.schedulers.DatabaseScheduler'
150CELERY_BROKER_URL = 'amqp://guest:guest@rabbitmq:5672//'
151CELERY_IMPORTS = "('administration.tasks',)"
152CLICKHOUSE_HOST = 'clickhouse'
153CORS_ALLOW_HEADERS = ['accept', 'accept-encoding', 'authorization', 'content-type', 'dnt', 'origin', 'user-agent', 'x-csrftoken', 'x-requested-with', 'content-disposition']
154CORS_ORIGIN_WHITELIST = ['http://95.213.252.8:8080', 'http://95.213.195.171:8080']
155CSRF_COOKIE_AGE = 31449600
156CSRF_COOKIE_DOMAIN = None
157CSRF_COOKIE_HTTPONLY = False
158CSRF_COOKIE_NAME = 'csrftoken'
159CSRF_COOKIE_PATH = '/'
160CSRF_COOKIE_SAMESITE = 'Lax'
161CSRF_COOKIE_SECURE = False
162CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'
163CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'
164CSRF_TRUSTED_ORIGINS = []
165CSRF_USE_SESSIONS = False
166DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'rephouse', 'USER': 'rephouse', 'PASSWORD': '********************', 'HOST': 'postgres', 'PORT': 5432, 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'OPTIONS': {}, 'TIME_ZONE': None, 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}}
167DATABASE_ROUTERS = []
168DATA_UPLOAD_MAX_MEMORY_SIZE = None
169DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000
170DATETIME_FORMAT = 'N j, Y, P'
171DATETIME_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']
172DATE_FORMAT = 'N j, Y'
173DATE_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']
174DEBUG = True
175DEBUG_PROPAGATE_EXCEPTIONS = False
176DECIMAL_SEPARATOR = '.'
177DEFAULT_CHARSET = 'utf-8'
178DEFAULT_CONTENT_TYPE = 'text/html'
179DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFilter'
180DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
181DEFAULT_FROM_EMAIL = 'webmaster@localhost'
182DEFAULT_INDEX_TABLESPACE = ''
183DEFAULT_TABLESPACE = ''
184DEPLOY_TOKEN = '********************'
185DISALLOWED_USER_AGENTS = []
186EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
187EMAIL_HOST = 'smtp.yandex.ru'
188EMAIL_HOST_PASSWORD = '********************'
189EMAIL_HOST_USER = 'reputation.house'
190EMAIL_PORT = '465'
191EMAIL_SSL_CERTFILE = None
192EMAIL_SSL_KEYFILE = '********************'
193EMAIL_SUBJECT_PREFIX = '[Django] '
194EMAIL_TIMEOUT = None
195EMAIL_USE_LOCALTIME = False
196EMAIL_USE_SSL = True
197EMAIL_USE_TLS = False
198FILE_CHARSET = 'utf-8'
199FILE_UPLOAD_DIRECTORY_PERMISSIONS = None
200FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler']
201FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440
202FILE_UPLOAD_PERMISSIONS = None
203FILE_UPLOAD_TEMP_DIR = None
204FIRST_DAY_OF_WEEK = 0
205FIXTURE_DIRS = []
206FORCE_SCRIPT_NAME = None
207FORMAT_MODULE_PATH = None
208FORM_RENDERER = 'django.forms.renderers.DjangoTemplates'
209IGNORABLE_404_URLS = []
210INSTALLED_APPS = ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'drf_yasg', 'rest_framework.authtoken', 'corsheaders', 'colorful', 'push_notifications', 'django_celery_beat', 'authorization', 'mentions', 'administration', 'app']
211INTERNAL_IPS = []
212LANGUAGES = [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('hy', 'Armenian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('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-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')]
213LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur']
214LANGUAGE_CODE = 'en-us'
215LANGUAGE_COOKIE_AGE = None
216LANGUAGE_COOKIE_DOMAIN = None
217LANGUAGE_COOKIE_NAME = 'django_language'
218LANGUAGE_COOKIE_PATH = '/'
219LOCALE_PATHS = []
220LOGGING = {}
221LOGGING_CONFIG = 'logging.config.dictConfig'
222LOGIN_REDIRECT_URL = '/accounts/profile/'
223LOGIN_URL = '/accounts/login/'
224LOGOUT_REDIRECT_URL = None
225MANAGERS = []
226MEDIA_ROOT = '/app/media/'
227MEDIA_URL = '/media/'
228MENTIONS_CACHE_TIME = 3600
229MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
230MIDDLEWARE = ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']
231MIGRATION_MODULES = {}
232MONTH_DAY_FORMAT = 'F j'
233NUMBER_GROUPING = 0
234PASSWORD_HASHERS = '********************'
235PASSWORD_RESET_TIMEOUT_DAYS = '********************'
236PREPEND_WWW = False
237PUSH_NOTIFICATIONS_SETTINGS = {'FCM_API_KEY': '********************', 'CONFIG': 'push_notifications.conf.LegacyConfig', 'GCM_POST_URL': 'https://android.googleapis.com/gcm/send', 'GCM_MAX_RECIPIENTS': 1000, 'GCM_ERROR_TIMEOUT': None, 'FCM_POST_URL': 'https://fcm.googleapis.com/fcm/send', 'FCM_MAX_RECIPIENTS': 1000, 'FCM_ERROR_TIMEOUT': None, 'APNS_USE_SANDBOX': True, 'APNS_USE_ALTERNATIVE_PORT': False, 'APNS_TOPIC': None, 'WNS_PACKAGE_SECURITY_ID': None, 'WNS_SECRET_KEY': '********************', 'WNS_ACCESS_URL': 'https://login.live.com/accesstoken.srf', 'WP_POST_URL': {'CHROME': 'https://fcm.googleapis.com/fcm/send', 'OPERA': 'https://fcm.googleapis.com/fcm/send', 'FIREFOX': 'https://updates.push.services.mozilla.com/wpush/v2'}, 'WP_PRIVATE_KEY': '********************', 'WP_CLAIMS': None, 'WP_ERROR_TIMEOUT': None, 'USER_MODEL': 'auth.User', 'UPDATE_ON_DUPLICATE_REG_ID': False}
238REPORT_TARGET_EMAIL = 'forafontov98@gmail.com'
239REST_FRAMEWORK = {'DEFAULT_PAGINATION_CLASS': 'mentions.paginators.FastPageNumberPagination', 'PAGE_SIZE': 25}
240ROOT_URLCONF = 'rephouse_backend.urls'
241SECRET_KEY = '********************'
242SECURE_BROWSER_XSS_FILTER = False
243SECURE_CONTENT_TYPE_NOSNIFF = False
244SECURE_HSTS_INCLUDE_SUBDOMAINS = False
245SECURE_HSTS_PRELOAD = False
246SECURE_HSTS_SECONDS = 0
247SECURE_PROXY_SSL_HEADER = None
248SECURE_REDIRECT_EXEMPT = []
249SECURE_SSL_HOST = None
250SECURE_SSL_REDIRECT = False
251SERVER_EMAIL = 'root@localhost'
252SESSION_CACHE_ALIAS = 'default'
253SESSION_COOKIE_AGE = 1209600
254SESSION_COOKIE_DOMAIN = None
255SESSION_COOKIE_HTTPONLY = True
256SESSION_COOKIE_NAME = 'sessionid'
257SESSION_COOKIE_PATH = '/'
258SESSION_COOKIE_SAMESITE = 'Lax'
259SESSION_COOKIE_SECURE = False
260SESSION_ENGINE = 'django.contrib.sessions.backends.db'
261SESSION_EXPIRE_AT_BROWSER_CLOSE = False
262SESSION_FILE_PATH = None
263SESSION_SAVE_EVERY_REQUEST = False
264SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
265SETTINGS_MODULE = 'rephouse_backend.settings'
266SHORT_DATETIME_FORMAT = 'm/d/Y P'
267SHORT_DATE_FORMAT = 'm/d/Y'
268SIGNING_BACKEND = 'django.core.signing.TimestampSigner'
269SILENCED_SYSTEM_CHECKS = []
270SMS_CODE_TIMEOUT = 600
271STATICFILES_DIRS = ['/app/rephouse_backend/static/']
272STATICFILES_FINDERS = ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder']
273STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
274STATIC_ROOT = '/app/static/'
275STATIC_URL = '/static/'
276SWAGGER_SETTINGS = {'DEFAULT_AUTO_SCHEMA_CLASS': 'rephouse_backend.swagger.ErrorResponseAutoSchema', 'SECURITY_DEFINITIONS': {'Token': '********************'}}
277TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/app/rephouse_backend/templates'], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages']}}]
278TEST_NON_SERIALIZED_APPS = []
279TEST_RUNNER = 'django.test.runner.DiscoverRunner'
280THOUSAND_SEPARATOR = ','
281TIME_FORMAT = 'P'
282TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
283TIME_ZONE = 'UTC'
284TWILIO_ACCOUNT_SID = 'ACec702ed7b7799dc5eb6212b6ca973ec8'
285TWILIO_AUTH_TOKEN = '********************'
286TWILIO_SENDER = '+14155211538'
287USE_I18N = True
288USE_L10N = True
289USE_THOUSAND_SEPARATOR = False
290USE_TZ = True
291USE_X_FORWARDED_HOST = False
292USE_X_FORWARDED_PORT = False
293WSGI_APPLICATION = 'rephouse_backend.wsgi.application'
294X_FRAME_OPTIONS = 'SAMEORIGIN'
295YEAR_MONTH_FORMAT = 'F Y'
296
297
298You're seeing this error because you have DEBUG = True in your
299Django settings file. Change that to False, and Django will
300display a standard page generated by the handler for this status code.