doableware / djongo

Django and MongoDB database connector
https://www.djongomapper.com
GNU Affero General Public License v3.0
1.86k stars 352 forks source link

No Exception Message supplied On Mongodb Reverse Relationship search_fields #604

Open balazaigo opened 2 years ago

balazaigo commented 2 years ago

No Exception Message Supplied Exception occuring on the Djongo

pymongo==3.12.1 djongo==1.3.6 sqlparse==0.2.4

My viewset ( I am using DRF)

class ChapterViewset(viewsets.ModelViewSet):
    #permission_classes = (IsAuthenticated, IsCoursePermitted,)
    serializer_class = ChapterSerializer
    pagination_class = StandardResultSetPagination
    filter_backends = [filters.SearchFilter, DjangoFilterBackend]
    filterset_fields = ['status']
    search_fields = ['name', 'description', 'chaptertopictag__name']
    queryset = Chapter.objects.all()

My models

class Chapter(models.Model):
    id = models.UUIDField(
        primary_key=True,
        default=uuid.uuid4,
        editable=False)
    name = models.CharField(max_length=256)
    short_code = models.CharField(max_length=256, blank=True)
    description = models.TextField(blank=True)
    start_date = models.DateField(default=None)
    end_date = models.DateField(default=None)
    status = models.PositiveIntegerField(default=1)
    created_by = models.CharField(max_length=256, default=None)

class ChapterTopicTag(models.Model):
    id = models.UUIDField(
        primary_key=True,
        default=uuid.uuid4,
        editable=False)
    name = models.CharField(max_length=256, blank=True)
    chapter_id = models.ForeignKey(Chapter, on_delete=models.CASCADE)
    chapter_topic_id = models.ForeignKey(ChapterTopic, on_delete=models.CASCADE, blank=True)

URL called: http://localhost:8000/chapters/?search=cddd

Traceback

DatabaseError at /chapters/

No exception message supplied
Request Method: | GET -- | -- http://localhost:8000/chapters/?search=ppp 4.0.1 DatabaseError /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/cursor.py, line 59, in execute /var/www/html/contentmicroservice/experenv/bin/python 3.8.10 ['/var/www/html/contentmicroservice', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages'] Tue, 15 Mar 2022 09:46:32 +0000
DatabaseError at /chapters/ No exception message supplied Request Method: GET Request URL: http://localhost:8000/chapters/?search=ppp Django Version: 4.0.1 Exception Type: DatabaseError Exception Location: /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/cursor.py, line 59, in execute Python Executable: /var/www/html/contentmicroservice/experenv/bin/python Python Version: 3.8.10 Python Path: ['/var/www/html/contentmicroservice', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages'] Server time: Tue, 15 Mar 2022 09:46:32 +0000 Traceback [Switch to copy-and-paste view](http://localhost:8000/chapters/?search=ppp#) /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/query.py, line 857, in parse return handler(self, statement) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/query.py, line 933, in _select return SelectQuery(self.db, self.connection_properties, sm, self._params) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/query.py, line 116, in __init__ super().__init__(*args) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/query.py, line 62, in __init__ self.parse() … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/query.py, line 123, in parse self.selected_columns = ColumnSelectConverter(self, statement) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/converters.py, line 44, in __init__ super().__init__(query, statement) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/converters.py, line 27, in __init__ self.parse() … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/converters.py, line 53, in parse for sql_token in SQLToken.tokens2sql(tok, self.query): … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/sql_tokens.py, line 49, in tokens2sql yield SQLFunc.token2sql(token, query) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/functions.py, line 24, in token2sql return CountFunc.token2sql(token, query) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/functions.py, line 78, in token2sql token[0].get_parameters()[0] … Local vars The above exception ('Identifier' object has no attribute 'get_parameters') was the direct cause of the following exception: /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/cursor.py, line 51, in execute self.result = Query( … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/query.py, line 784, in __init__ self._query = self.parse() … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/sql2mongo/query.py, line 885, in parse raise exe from e … Local vars The above exception ( Keyword: None Sub SQL: None FAILED SQL: SELECT COUNT(*) FROM (SELECT DISTINCT "course_app_chapter"."id" AS "col1", "course_app_chapter"."name" AS "col2", "course_app_chapter"."short_code" AS "col3", "course_app_chapter"."description" AS "col4", "course_app_chapter"."start_date" AS "col5", "course_app_chapter"."end_date" AS "col6", "course_app_chapter"."status" AS "col7", "course_app_chapter"."created_by" AS "col8" FROM "course_app_chapter" LEFT OUTER JOIN "course_app_chaptertopictag" ON ("course_app_chapter"."id" = "course_app_chaptertopictag"."chapter_id_id") WHERE ("course_app_chapter"."name" iLIKE %(0)s OR "course_app_chapter"."description" iLIKE %(1)s OR "course_app_chaptertopictag"."name" iLIKE %(2)s)) subquery Params: ('%ppp%', '%ppp%', '%ppp%') Version: 1.3.6) was the direct cause of the following exception: /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/backends/utils.py, line 85, in _execute return self.cursor.execute(sql, params) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/cursor.py, line 59, in execute raise db_exe from e … Local vars The above exception () was the direct cause of the following exception: /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/core/handlers/exception.py, line 47, in inner response = get_response(request) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/core/handlers/base.py, line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/views/decorators/csrf.py, line 54, in wrapped_view return view_func(*args, **kwargs) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/rest_framework/viewsets.py, line 125, in view return self.dispatch(request, *args, **kwargs) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/rest_framework/views.py, line 509, in dispatch response = self.handle_exception(exc) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/rest_framework/views.py, line 469, in handle_exception self.raise_uncaught_exception(exc) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/rest_framework/views.py, line 480, in raise_uncaught_exception raise exc … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/rest_framework/views.py, line 506, in dispatch response = handler(request, *args, **kwargs) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/rest_framework/mixins.py, line 40, in list page = self.paginate_queryset(queryset) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/rest_framework/generics.py, line 171, in paginate_queryset return self.paginator.paginate_queryset(queryset, self.request, view=self) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/rest_framework/pagination.py, line 204, in paginate_queryset self.page = paginator.page(page_number) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/core/paginator.py, line 76, in page number = self.validate_number(number) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/core/paginator.py, line 54, in validate_number if number > self.num_pages: … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/utils/functional.py, line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/core/paginator.py, line 103, in num_pages if self.count == 0 and not self.allow_empty_first_page: … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/utils/functional.py, line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/core/paginator.py, line 97, in count return c() … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/models/query.py, line 416, in count return self.query.get_count(using=self.db) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/models/sql/query.py, line 516, in get_count number = obj.get_aggregation(using, ['__count'])['__count'] … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/models/sql/query.py, line 501, in get_aggregation result = compiler.execute_sql(SINGLE) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/models/sql/compiler.py, line 1202, in execute_sql cursor.execute(sql, params) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/backends/utils.py, line 99, in execute return super().execute(sql, params) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/backends/utils.py, line 67, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/backends/utils.py, line 76, in _execute_with_wrappers return executor(sql, params, many, context) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/backends/utils.py, line 85, in _execute return self.cursor.execute(sql, params) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/utils.py, line 90, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/django/db/backends/utils.py, line 85, in _execute return self.cursor.execute(sql, params) … Local vars /var/www/html/contentmicroservice/experenv/lib/python3.8/site-packages/djongo/cursor.py, line 59, in execute raise db_exe from e … Local vars Request information USER AnonymousUser GET Variable Value search 'ppp' POST No POST data FILES No FILES data COOKIES Variable Value csrftoken 'SNwIh64PY85CISGRwWXzpk7be67CR4oxH14XEsNyb2zhvYqsiRXx2XlJQBxrzabc' META Variable Value COLORTERM 'truecolor' CONTENT_LENGTH '' CONTENT_TYPE 'text/plain' CSRF_COOKIE 'SNwIh64PY85CISGRwWXzpk7be67CR4oxH14XEsNyb2zhvYqsiRXx2XlJQBxrzabc' DBUS_SESSION_BUS_ADDRESS 'unix:path=/run/user/1000/bus' DEFAULTS_PATH '/usr/share/gconf/ubuntu.default.path' DESKTOP_SESSION 'ubuntu' DISPLAY ':0' DJANGO_SETTINGS_MODULE 'COURSE.settings' GATEWAY_INTERFACE 'CGI/1.1' GDMSESSION 'ubuntu' GJS_DEBUG_OUTPUT 'stderr' GJS_DEBUG_TOPICS 'JS ERROR;JS LOG' GNOME_DESKTOP_SESSION_ID 'this-is-deprecated' GNOME_SHELL_SESSION_MODE 'ubuntu' GNOME_TERMINAL_SCREEN '/org/gnome/Terminal/screen/6b298369_2be0_4a5f_93d2_b6e70e231305' GNOME_TERMINAL_SERVICE ':1.161' GPG_AGENT_INFO '/run/user/1000/gnupg/S.gpg-agent:0:1' GTK_MODULES 'gail:atk-bridge' HOME '/home/bala' HTTP_ACCEPT 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' HTTP_ACCEPT_ENCODING 'gzip, deflate, br' HTTP_ACCEPT_LANGUAGE 'en-GB,en-US;q=0.9,en;q=0.8' HTTP_CONNECTION 'keep-alive' HTTP_COOKIE 'csrftoken=SNwIh64PY85CISGRwWXzpk7be67CR4oxH14XEsNyb2zhvYqsiRXx2XlJQBxrzabc' HTTP_HOST 'localhost:8000' HTTP_SEC_CH_UA '" Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"' HTTP_SEC_CH_UA_MOBILE '?0' HTTP_SEC_CH_UA_PLATFORM '"Linux"' HTTP_SEC_FETCH_DEST 'document' HTTP_SEC_FETCH_MODE 'navigate' HTTP_SEC_FETCH_SITE 'none' HTTP_SEC_FETCH_USER '?1' HTTP_UPGRADE_INSECURE_REQUESTS '1' HTTP_USER_AGENT ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/99.0.4844.51 Safari/537.36') IM_CONFIG_PHASE '1' INVOCATION_ID 'fa47fb805d024a3daca874fd302ef01f' JOURNAL_STREAM '8:45934' LANG 'en_IN' LANGUAGE 'en_IN:en' LESSCLOSE '/usr/bin/lesspipe %s %s' LESSOPEN '| /usr/bin/lesspipe %s' LOGNAME 'bala' LS_COLORS 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:' MANAGERPID '1768' MANDATORY_PATH '/usr/share/gconf/ubuntu.mandatory.path' OLDPWD '/var/www/html' PATH '/var/www/html/contentmicroservice/experenv/bin:/home/bala/.npm-global/bin:/home/bala/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin' PATH_INFO '/chapters/' PS1 ('(experenv) \\[\\e]0;\\u@\\h: ' '\\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ') PWD '/var/www/html/contentmicroservice' QT_ACCESSIBILITY '1' QT_IM_MODULE 'ibus' QUERY_STRING 'search=ppp' REMOTE_ADDR '127.0.0.1' REMOTE_HOST '' REQUEST_METHOD 'GET' RUN_MAIN 'true' SCRIPT_NAME '' SERVER_NAME 'localhost' SERVER_PORT '8000' SERVER_PROTOCOL 'HTTP/1.1' SERVER_SOFTWARE 'WSGIServer/0.2' SESSION_MANAGER 'local/Zaigo:@/tmp/.ICE-unix/1983,unix/Zaigo:/tmp/.ICE-unix/1983' SHELL '/bin/bash' SHLVL '1' SSH_AGENT_PID '1945' SSH_AUTH_SOCK '/run/user/1000/keyring/ssh' TERM 'xterm-256color' TZ 'UTC' USER 'bala' USERNAME 'bala' VIRTUAL_ENV '/var/www/html/contentmicroservice/experenv' VTE_VERSION '6003' WINDOWPATH '2' XAUTHORITY '/run/user/1000/gdm/Xauthority' XDG_CONFIG_DIRS '/etc/xdg/xdg-ubuntu:/etc/xdg' XDG_CURRENT_DESKTOP 'ubuntu:GNOME' XDG_DATA_DIRS '/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop' XDG_MENU_PREFIX 'gnome-' XDG_RUNTIME_DIR '/run/user/1000' XDG_SESSION_CLASS 'user' XDG_SESSION_DESKTOP 'ubuntu' XDG_SESSION_TYPE 'x11' XMODIFIERS '@im=ibus' _ '/var/www/html/contentmicroservice/experenv/bin/python' wsgi.errors <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> wsgi.file_wrapper wsgi.input wsgi.multiprocess False wsgi.multithread True wsgi.run_once False wsgi.url_scheme 'http' wsgi.version (1, 0) Settings Using settings module COURSE.settings Setting Value ABSOLUTE_URL_OVERRIDES {} ADMINS [] ADMIN_MICROSERVICE 'http://127.0.0.1:8001/' ALLOWED_HOSTS ['*'] APPEND_SLASH True AUTHENTICATION_BACKENDS ['django.contrib.auth.backends.ModelBackend'] AUTH_PASSWORD_VALIDATORS '********************' AUTH_USER_MODEL 'auth.User' BASE_DIR '/var/www/html/contentmicroservice' CACHES {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} CACHE_MIDDLEWARE_ALIAS 'default' CACHE_MIDDLEWARE_KEY_PREFIX '********************' CACHE_MIDDLEWARE_SECONDS 600 CORS_ALLOW_ALL_ORIGINS True CSRF_COOKIE_AGE 31449600 CSRF_COOKIE_DOMAIN None CSRF_COOKIE_HTTPONLY False CSRF_COOKIE_NAME 'csrftoken' CSRF_COOKIE_PATH '/' CSRF_COOKIE_SAMESITE 'Lax' CSRF_COOKIE_SECURE False CSRF_FAILURE_VIEW 'django.views.csrf.csrf_failure' CSRF_HEADER_NAME 'HTTP_X_CSRFTOKEN' CSRF_TRUSTED_ORIGINS [] CSRF_USE_SESSIONS False DATABASES {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CLIENT': {'host': '127.0.0.1:27017'}, 'CONN_MAX_AGE': 0, 'ENGINE': 'djongo', 'HOST': '', 'NAME': 'content_micro', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': ''}} DATABASE_ROUTERS [] DATA_UPLOAD_MAX_MEMORY_SIZE 2621440 DATA_UPLOAD_MAX_NUMBER_FIELDS 1000 DATETIME_FORMAT 'N j, Y, P' DATETIME_INPUT_FORMATS ['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M'] DATE_FORMAT 'N j, Y' 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'] DEBUG True DEBUG_PROPAGATE_EXCEPTIONS False DECIMAL_SEPARATOR '.' DEFAULT_AUTO_FIELD 'django.db.models.BigAutoField' DEFAULT_CHARSET 'utf-8' DEFAULT_EXCEPTION_REPORTER 'django.views.debug.ExceptionReporter' DEFAULT_EXCEPTION_REPORTER_FILTER 'django.views.debug.SafeExceptionReporterFilter' DEFAULT_FILE_STORAGE 'django.core.files.storage.FileSystemStorage' DEFAULT_FROM_EMAIL 'webmaster@localhost' DEFAULT_INDEX_TABLESPACE '' DEFAULT_TABLESPACE '' DISALLOWED_USER_AGENTS [] EMAIL_BACKEND 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST 'localhost' EMAIL_HOST_PASSWORD '********************' EMAIL_HOST_USER '' EMAIL_PORT 25 EMAIL_SSL_CERTFILE None EMAIL_SSL_KEYFILE '********************' EMAIL_SUBJECT_PREFIX '[Django] ' EMAIL_TIMEOUT None EMAIL_USE_LOCALTIME False EMAIL_USE_SSL False EMAIL_USE_TLS False FILE_UPLOAD_DIRECTORY_PERMISSIONS None FILE_UPLOAD_HANDLERS ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler'] FILE_UPLOAD_MAX_MEMORY_SIZE 2621440 FILE_UPLOAD_PERMISSIONS 420 FILE_UPLOAD_TEMP_DIR None FIRST_DAY_OF_WEEK 0 FIXTURE_DIRS [] FORCE_SCRIPT_NAME None FORMAT_MODULE_PATH None FORM_RENDERER 'django.forms.renderers.DjangoTemplates' IGNORABLE_404_URLS [] INSTALLED_APPS ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'course_app', 'rest_framework', 'django_filters', 'corsheaders', 'drf_yasg', 'rest_framework_simplejwt'] INTERNAL_IPS [] LANGUAGES [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ar-dz', 'Algerian 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'), ('ig', 'Igbo'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('ky', 'Kyrgyz'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('ms', 'Malay'), ('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'), ('tg', 'Tajik'), ('th', 'Thai'), ('tk', 'Turkmen'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('uz', 'Uzbek'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')] LANGUAGES_BIDI ['he', 'ar', 'ar-dz', 'fa', 'ur'] LANGUAGE_CODE 'en-us' LANGUAGE_COOKIE_AGE None LANGUAGE_COOKIE_DOMAIN None LANGUAGE_COOKIE_HTTPONLY False LANGUAGE_COOKIE_NAME 'django_language' LANGUAGE_COOKIE_PATH '/' LANGUAGE_COOKIE_SAMESITE None LANGUAGE_COOKIE_SECURE False LOCALE_PATHS [] LOGGING {} LOGGING_CONFIG 'logging.config.dictConfig' LOGIN_REDIRECT_URL '/accounts/profile/' LOGIN_URL '/accounts/login/' LOGOUT_REDIRECT_URL None MANAGERS [] MEDIA_ROOT '/var/www/html/contentmicroservice/media' MEDIA_URL '/media/' MESSAGE_STORAGE 'django.contrib.messages.storage.fallback.FallbackStorage' MIDDLEWARE ['django.middleware.security.SecurityMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] MIGRATION_MODULES {} MONTH_DAY_FORMAT 'F j' NUMBER_GROUPING 0 PASSWORD_HASHERS '********************' PASSWORD_RESET_TIMEOUT '********************' PREPEND_WWW False REST_FRAMEWORK {'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework_simplejwt.authentication.JWTTokenUserAuthentication'], 'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'], 'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'} ROOT_URLCONF 'COURSE.urls' SECRET_KEY '********************' SECURE_CONTENT_TYPE_NOSNIFF True SECURE_CROSS_ORIGIN_OPENER_POLICY 'same-origin' SECURE_HSTS_INCLUDE_SUBDOMAINS False SECURE_HSTS_PRELOAD False SECURE_HSTS_SECONDS 0 SECURE_PROXY_SSL_HEADER None SECURE_REDIRECT_EXEMPT [] SECURE_REFERRER_POLICY 'same-origin' SECURE_SSL_HOST None SECURE_SSL_REDIRECT False SERVER_EMAIL 'root@localhost' SESSION_CACHE_ALIAS 'default' SESSION_COOKIE_AGE 1209600 SESSION_COOKIE_DOMAIN None SESSION_COOKIE_HTTPONLY True SESSION_COOKIE_NAME 'sessionid' SESSION_COOKIE_PATH '/' SESSION_COOKIE_SAMESITE 'Lax' SESSION_COOKIE_SECURE False SESSION_ENGINE 'django.contrib.sessions.backends.db' SESSION_EXPIRE_AT_BROWSER_CLOSE False SESSION_FILE_PATH None SESSION_SAVE_EVERY_REQUEST False SESSION_SERIALIZER 'django.contrib.sessions.serializers.JSONSerializer' SETTINGS_MODULE 'COURSE.settings' SHORT_DATETIME_FORMAT 'm/d/Y P' SHORT_DATE_FORMAT 'm/d/Y' SIGNING_BACKEND 'django.core.signing.TimestampSigner' SILENCED_SYSTEM_CHECKS [] STATICFILES_DIRS [] STATICFILES_FINDERS ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] STATICFILES_STORAGE 'django.contrib.staticfiles.storage.StaticFilesStorage' STATIC_ROOT '/var/www/html/contentmicroservice/static' STATIC_URL '/static/' TEMPLATES [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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']}}] TEST_NON_SERIALIZED_APPS [] TEST_RUNNER 'django.test.runner.DiscoverRunner' THOUSAND_SEPARATOR ',' TIME_FORMAT 'P' TIME_INPUT_FORMATS ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] TIME_ZONE 'UTC' USE_DEPRECATED_PYTZ False USE_I18N True USE_L10N True USE_THOUSAND_SEPARATOR False USE_TZ True USE_X_FORWARDED_HOST False USE_X_FORWARDED_PORT False WELLSAID_API_KEY '********************' WELLSAID_API_URL '********************' WSGI_APPLICATION 'COURSE.wsgi.application' X_FRAME_OPTIONS 'DENY' YEAR_MONTH_FORMAT 'F Y'
balazaigo commented 2 years ago

Attaching Screenshot of the exception. Screenshot from 2022-03-15 15-26-20 Screenshot from 2022-03-15 15-26-18 Screenshot from 2022-03-15 15-26-14 Screenshot from 2022-03-15 15-26-10 Screenshot from 2022-03-15 15-26-05 Screenshot from 2022-03-15 15-26-01 Screenshot from 2022-03-15 15-25-57 Screenshot from 2022-03-15 15-25-48 Screenshot from 2022-03-15 15-25-45 Screenshot from 2022-03-15 15-25-42 Screenshot from 2022-03-15 15-25-37 Screenshot from 2022-03-15 15-25-33 Screenshot from 2022-03-15 15-25-30 Screenshot from 2022-03-15 15-25-24 Screenshot from 2022-03-15 15-25-20 Screenshot from 2022-03-15 15-25-16 Screenshot from 2022-03-15 15-25-05

rlivermorejr commented 2 years ago

I have been having this same exact error. I was first getting it on my index.html page. Then I fixed it by adding:

if not request.user.is_authenticated:
        return render(request, 'index.html')

to the beginning of my index_page view, but now I get it on every other page of my application. all of my views have "try" and "excepts" so I don't get what the issue is.

I have had this error for months now, tried to post on StackOverflow and everyone just downvoted my question instead of actually trying to help.

balazaigo commented 2 years ago

@rlivermorejr - If anyone points us out to update the x version of this package to y version or else if they provide us a solution it will be helpful for us. If i ran that query in django shell then it is working fine and it is providing me the actual results, but if i place that in search_fields it is not working. I am not sure what we can do for this one.

rlivermorejr commented 2 years ago

Yeah, I am not sure either, I tried to fix the other pages in my app with that piece of code and it just wouldn't fix anything but the homepage, so it really doesn't make sense to me.

I ended up giving up on trying to figure this one out. I took all the djongo stuff out of my application and just deployed to heroku because I need to get my app on my resume for job applications. I hope someone can help with this though because I cannot upload images and stuff without using MongoDB.