Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Implementing django authentication system for my project
Going bit lengthy so that you can get complete picture.. I am building a ticketing system (called TS for short in post ) for a issue resolving for the product (called P for short in post ) in my company. The TS has 2 type of users : customers (which are also employee of same company but in other location ) company internal people (includes developers/project manager/product owner ..etc) Note: Company uses Ldap for authentication. customers raise a ticket from P giving all information/problem(like username, issue description etc) and it gets stored in a central database. The ticket raiser gets a link via mail to track the progress of ticket like http://127.0.0.1:8000/cust_view/12 here 12 is ticket id of ticket the customer raised. Note: while raising ticket from P the customer provides its username which is checked in backend (using LDAP) for successful ticket generation(which i implemented successfully). when clicking the above link the customer should be redirected to a login page like http://127.0.0.1:8000/customer_login/?next=/cust_view/12(if the customer is not logged in) or will be in http://127.0.0.1:8000/cust_view/12 displaying that customer is authenticated but is not authorized to view this ticket detail if the user is logged in from previous session but not authorized … -
Apache jena-useki server refuses connection when running tests from a shell script
I'm unittesting an application that uses apache-jena-fuseki from python backend with sprql. I didn't find any means for using an in-memory jena test-db, thus I decided to start a test-fuseki-server from the shell script that runs my tests. #!/bin/sh set -x cd jena/apache-jena-fuseki-3.13.1 nohup jena/apache-jena-fuseki-3.13.1/fuseki-server --update --file sandbox_2019-11-20_10-57-04.nq / >/dev/null 2>&1 & export pid=$! cd - JENASERVERPASSWORD="<myJenaPw>" \ JENASERVERUSERNAME="rommi" \ DBPASS="" \ DBUSER="" \ DBHOST="" \ DBNAME='db.sqlite31' \ DBENGINE="django.db.backends.sqlite3" \ JENAHOST="http://localhost:3030" \ JENADATABASE="{0}/ds/{1}" \ python manage.py test kill -9 $pid Every time when I run the script above I get "Connection refused error" errno 111 in the middle of the execution even though my fuseki-server is up and even though the previous tests succeeded. I've also tried without the last command (kill -9), but it does not help. If I run the above commands manually everything goes fine. What can be the reason ? -
How to provide a validation check for inputting the right file path (remote or local server) in Django?
I have a form that should accept a file path (directory) if it's within a valid format (regardless of it being in a remote/local server i.e FTP) and does not contain any specific files i.e <'file_directory'>\pic.png'. If the path is not valid, it should not save it into the model. I have tried the following: views.py: from pathlib import Path as PATH #using pathlib since it's used on all OS platforms. def home(request): if request.method == 'POST': form = PForm(request.POST) if form.is_valid(): user_id = request.user.id folder_path = form.cleaned_data['folder_path'] path = PATH(folder_path) #using pathlib module to check if the folder_path exists. root, extension = os.path.splitext(folder_path) #checks if extension is seen in folder_path. if extension or not path.resolve(strict=True): messages.warning(request, "Path is not valid.") return redirect('home') else: #save the path to the model else: form = PForm() return render(request, 'template/home.html, {'form' : form}) The validation for checking file extensions work but once I enter an invalid directory path, I am getting this error: Exception Type: FileNotFoundError Exception Value: [WinError 3] The system cannot find the path specified: '<invalid pathname>' #eg 'var/html/www/pictures' How can I implement a better validation check and a way to handle the errors? Thank you in advance. -
uwsgi: OSError: write error during GET request
Here is the error log that I received when I put my application on a long run. Oct 22 11:41:18 uwsgi[4613]: OSError: write error Oct 22 11:41:48 uwsgi[4613]: Tue Oct 22 11:41:48 2019 - uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 341] during GET /api/events/system-alarms/ Nov 19 19:11:01 uwsgi[30627]: OSError: write error Nov 19 19:11:02 uwsgi[30627]: Tue Nov 19 19:11:02 2019 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /api/statistics/connected-clients/?type=auto&required_fields=0,11 Also I need to know the reason for the os write error and broken pipe in detail. -
Django check if next record will change (ifchanged, but in the future)
In Django, there is a very handy ifchanged function. However, instead of using ifchanged to look up if the current record has changed from the previous record, I am trying to find out if the next record will change from the current record. Something like this: {% for record in list %} {% ifchanged record.date %}<h1>{{ record.date }}</h1>{% endifchanged %} <p>- {{ record.title }}</p> {% ifwillchange record.date %} <p>View more details for <a href="list?date={{ record.date }}">{{ record.date }}</a></p> {% ifwillchange %} {% endfor %} Does something like this exist? If not, what would be another way to achieve this? Just FYI I am trying to print a link underneath each group of records that has a particular date, like so: Jan 10, 2020 Record 1 Record 2 Record 3 View more on Jan 10, 2020 Jan 11, 2020 Record 4 Record 5 View more on Jan 11, 2020 etc. -
Blocked by CORS policy on form submit - Django
I have a form on a website, where I have a form to capture the lead. - Tech is Php The action on this form goes to another django project where I save it to the database. - Tech is Django Now I have used django-cors-headers==2.4.0 for handling the CORS part. In my settings.py CSRF_TRUSTED_ORIGINS = ['www.test.com', 'test.com', 'https://test.com'] CORS_ORIGIN_WHITELIST = ( 'www.test.com', 'test.com', 'https://test.com' ) INSTALLED_APPS = [ 'corsheaders' ] MIDDLEWARE = [ 'corsheaders.middleware.CorsMiddleware' ] Still after this I am getting this error when I submit the form(ajax function doesn't goes to he success instead it goes to the error): Access to XMLHttpRequest at 'https://test1.com/crm/addnewlead_website/' from origin 'https://test.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested What am i doing wrong? resource. -
Django form doesn't show error on template page
My code is exactly the same as https://simpleisbetterthancomplex.com/series/2017/09/18/a-complete-beginners-guide-to-django-part-3.html#rendering-bootstrap-forms this. But when I click on the "post" button in the template it shows me the same page without the errors like the field is required. In my virtualenv, Python 3.7.4, Django 2.2.7 and I've installed Django-widgets-improved. -
how do i return in my class based view after updating data
here is my views.py function: class ProfileUpdateView(UpdateView): model = UserProfile fields = ['first_name','last_name','username','gender','datetimepicker','p_photo','h_photo','subtitles','political_incline', 'about_me','birthplace','lives_in','country','province','city','occupation', 'relationship_status','website','phone_number','religious_belifs','political_incline', 'facebook','twitter','RSS','dibble','spotify'] AND HERE IS MY URLS.PY PATH: url(r'^updateprofile/(?P\d+)/$',views.ProfileUpdateView.as_view(success_url='/postlist/')), -
I want to pass a argument to Django meta class , like this
I can alternatively create different types of form, but that's tedious. So is it possible to pass the type to the form,then show the form accordingly ? This code shows NameError: name 'review_type' is not defined class Contest1_for_review(ModelForm, review_type): class Meta: model = Contest1 decision = review_type + '_decision' comment = review_type +'comment' fields = [ decision, comment, ] -
Django form data not saving into databsae
I have a form on web app, using to get the data and store into database. The problem is: I am using different fields along with 2 Date Fields. When I removed the 2 date fields from the Model and Form, the form data stores easily into database but when added again into the Model and Form, it dose not save anything into database. Model: name = models.CharField('Name', max_length=50, help_text='Co-worker name.') email = models.EmailField('Email', help_text='Co-worker email.') address = models.TextField('Address', help_text='Co-worker address.') phone = models.CharField('Phone Number', max_length=20, help_text='Co-worker phone number.') companyName = models.CharField('Company Name', max_length=80, help_text='Co-worker company name.', null=True, blank=True) workingLocation = models.CharField('Working Location', max_length=50, help_text='Co-worker working ' 'location.') workingShift = models.CharField('Working Shift', max_length=50, help_text='Co-worker working shift.', default='') workingSpace = models.CharField('Working Space', max_length=50, help_text='Co-worker working space.', default='') teamMembers = models.CharField('Team Members', max_length=15, help_text="Co-Worker's Team Size.", default='') coworkerPicture = models.ImageField('Co-Worker Picture', upload_to='../media/images/co-woker-pictures' , help_text='Co-worker Picture.', default='profile_pics/default.jpg', ) joiningDate = models.DateField('Joining Date', help_text='Joining Date of Co-worker',default=date.today, ) dob = models.DateField('Date of Birth', help_text='Date of Birth of Co-worker', default=date.today, View: def Coworkers(request): # If user is not logged In if not request.user.is_authenticated: return redirect('login') if request.method == 'POST': form = addCoWorkerForm(request.POST, request.FILES) print(request.POST) if form.is_valid(): form.save() messages.success(request, 'Co-Worker added successfully.') return redirect('admin/co-workers') c = … -
data retrieving from data base 1 after another in 1 page Django
guys i was building an online quiz computation.In the user side i need to display questions 1 at a time onclick next, next question should display.Here i am able to retrieve question from database.But all are displaying in 1 page like i have 1200 questions in total. what functionality and method i need to use here. language - python ; frame-work - django ; database - mysql; frontend - Html, css, javascript . thanks in advance.enter image description herebelow attachment is template -
How to update user and profile properly in django rest framework?
Here I am trying to update user and user_profile model.This updates the user but the one problem with this is: If I don't provide the address or any other field then it becomes blank after updating.How can I solve this ? Also There is not pre-populating user's data in the update form.In the update form isn't there should be user's data already in the form? models.py class Profile(models.Model): user = models.OneToOneField(get_user_model(),on_delete=models.CASCADE,related_name='profile') address = models.CharField(max_length=250,blank=True,null=True) serializer.py class UpdateUserSerializer(serializers.ModelSerializer): profile = ProfileSerializer() class Meta: model = get_user_model() fields = ['first_name', 'last_name', 'profile'] def update(self, instance, validated_data): instance.username = validated_data.get('username', instance.username) instance.email = validated_data.get('email', instance.email) instance.first_name = validated_data.get('first_name', instance.first_name) instance.last_name = validated_data.get('last_name', instance.last_name) instance.save() profile_data = validated_data.pop('profile') instance.profile.address = profile_data.get('address', instance.profile.address) instance.profile.save() return instance views.py class UpdateUser(generics.UpdateAPIView): serializer_class = UpdateUserSerializer queryset = get_user_model().objects.all() -
Django error to final deployment not finding url
any idea why this could not be working?? when in urls.py does not give any error except when in production. this is the error when deploying. ModuleNotFoundError at /admin No module named 'djangopdf.project' Request Method: GET Request URL: https://pdfshellapp.herokuapp.com/admin Django Version: 2.2.7 Exception Type: ModuleNotFoundError Exception Value: No module named 'djangopdf.project' Exception Location: /app/djangopdf/urls.py in <module>, line 18 Python Executable: /app/.heroku/python/bin/python Python Version: 3.6.9 Python Path: ['/app/.heroku/python/bin', '/app', '/app/.heroku/python/lib/python36.zip', '/app/.heroku/python/lib/python3.6', '/app/.heroku/python/lib/python3.6/lib-dynload', '/app/.heroku/python/lib/python3.6/site-packages'] Server time: Mon, 25 Nov 2019 04:34:24 +0000 this is my urls.py: from django.contrib import admin from django.urls import path from djangopdf.project import views urlpatterns = [ path('admin/', admin.site.urls), path('', views.HOME.as_view(), name='home'), path('signup/', views.signup_views, name='signup'), path('contact/', views.contact, name='contact'), path('main/', views.upload, name='main'), path('logout/', views.logout_views, name='logout'), path('login/', views.login_views, name='login'), ] -
Django group by max in a migration
How do you write a group-by aggregate that works in a Django migration? I have two models, Parent and Child. One parent can have hundreds of child records linked through a parent ForeignKey column in the child. I've added a new column called max_timestamp to Parent which I want to use to cache the largest Child.timestamp value. To efficiently update this retroactively, I need to run the equivalent of: SELECT parent_id, MAX(timestamp) AS max_timestamp FROM myapp_child GROUP BY parent_id; in Django's ORM, and the use that query to update the Parent records. Seems pretty simple, right? The ORM usage should be similar to the answer presented here. However, it's not working. My migration looks like: from django.db import migrations from django.db.models import Max def update(apps, schema_editor): Child = apps.get_model("myapp", "Child") Parent = apps.get_model("myapp", "Parent") qs = Child.objects.all().values('parent_id').annotate(max_timestamp=Max('timestamp')).distinct() total = qs.count() print('count:', total) i = 0 for data in qs.iterator(): print(data) parent = Parent.objects.get(id=data['parent_id']) parent.max_timestamp = data['max_timestamp'] parent.save() class Migration(migrations.Migration): dependencies = [ ('myapp', '0001_add_timestamp'), ] operations = [ migrations.RunPython(update), ] Yet when I run the migration, it doesn't seem to actually aggregate, and I see output with duplicate parent_ids like: {'parent_id': 94, 'max_created': datetime.datetime(2019, 9, 8, 20, 1, 52, 700533, … -
Azures' windows VM is getiing restarted 1-3 times daily running simple Django server
I'm running a Django server in a Windows VM in the Azure portal. I'm running Windows server 2019 8 GB ram and 4 virtual processors. The Server has a 10-30 request per minute, and the main function is to parse a file in an external software using pyautogui to interact with the buttons of the external software. Since I'm using that library I have to have the connection always open in another VM. but this last never get restarted running the same Django server (with the difference that this not receive requests) the Event Viewer of windows never has any insight about the issue... so I would like to know if any of you have faced something similar? It would be very helpful any help. I have had this issue a long long time ago and right now the only solution is having a status bot to check the server availability and knowing when i have to restart it. -
How to upload files to media folder on django using angular?
I'm trying to upload a file using angular on django but its not saving it on the media folder. It just saves it on the database. I have tested the api on postman and it saves the file on the database and on the media folder. But when i used angular, it just saves it on the database. Below is my angular code: file.component.ts saveFileForm() { let file = this.fileForm.get('contentFile').value; let final_file = file.replace("C:\\fakepath\\", ""); console.log('file', final_file); this.coursemoduleService.uploadFile( this.contentDetails.content.id, final_file ).subscribe( result => console.log(result), error => console.log(error) ); } file.component.html <div class="modal fade" id="newFileForm" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">Upload File</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <form [formGroup]="fileForm" (ngSubmit)="saveFileForm()" enctype="multipart/form-data"> <div class="modal-body m-3"> <div class="form-group"> <label class="form-label w-100">File input</label> <input type="file" formControlName="contentFile"> <small class="form-text text-muted">Example block-level help text here.</small> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-success">Save changes</button> </div> </form> </div> </div> </div> Below is my django code. @action(detail=True, methods=['POST']) def file(self, request, pk=None): contentfile = request.data['contentfile'] content = Content.objects.get(id=pk) contentItemCount = ContentItem.objects.filter(contentitem_content_id=pk).count() contentItemCount += 1 contentitem = ContentItem.objects.create( contentitem_type = 1, contentitem_order = contentItemCount, contentitem_content_id = content ) print(contentitem) contentFile = ContentFile.objects.create( contentfile = … -
Django NoReverseMatch at /provider/ 'providers' is not a registered namespace
i'm learning django . having the above error when rendering the provider page , if i removed the the html code the page will load without error but with the below code it give the above error thank in advance the html: ''' <ul class="all-cat-list"> {% for category in category_list %} <li><a href="{% url 'providers: provider_list_category' category.slug %}">{{category}} <span class="num-of-ads">({{category.total_providers}})</span></a></li> {% endfor%} </ul> </div> <ol class="breadcrumb" style="margin-bottom: 5px;"> <li><a href="/">Home</a></li> <li class="active"><a active href="{% url 'providers :provider_list' %}> All Categories </a> </li> {% if category %} <li class="active">{{category}} </li> {% endif%} </ol> <div class="ads-grid"> <div class="side-bar col-md-3"> <div class="search-hotel"> <h3 class="sear-head">Search</h3> <form method="GET" action="{url 'providers : provider_list' %}"> <input type="text" value="Product name..." name ="q" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Product name...';}" required=""> <input type="submit" value=" "> </form> </div> ''' the Views: '''' def providerlist(request,category_slug = None): category = None providerlist = Provider.objects.all() categorylist = Category.objects.annotate(total_providers=Count('provider')) if category_slug: category= get_object_or_404(Category, slug = category_slug) providerlist = Category.filter(category=category) search_query = request.GET.get('q') if search_query : providerlist = providerlist.filter( Q(name__icontains=search_query) | Q(description__icontains=search_query)| Q(category__category__name__icontains = search_query) ) template = 'provider/provider_list.html' context = {'provider_list': providerlist ,'category_list' : categorylist} return render(request,template,context) def providerdetail(request,provider_slug): #print(provider_slug) providerdetail=get_object_or_404(Provider,slug=provider_slug) providerimage = ProviderImages.objects.filter(provider = providerdetail) template ='provider/provider_detail.html' context = … -
Passing variable between view and JS; Django
I am first passing a JS variable 'confirmed' to my Django view via POST request. I then run a python script which takes this variable and does some processing. Finally I want to pass it back to my html/JS so I can display the processed data. I am currently trying to use Django sessions to achieve my goal but there is a '1 session delay', so the session variable which I update is returning as the value from the previous session. Is there a better way I can pass the variable from my view to JS/a fix for my current solution? VIEW: def crossword(request): if request.method == 'POST': Session.objects.all().delete() str_squares = (request.body).decode('utf-8') squares = [int(i) for i in str_squares.split(',')] letters = puzzle_solver.solve_puzzle(3, squares) # print(letters) for each_square in letters.keys(): request.session[each_square] = letters[each_square] request.session.modified = True return render(request, 'crossword.html') JS: // Output a list of active squares var xhr = new XMLHttpRequest(); var generate = { Generate:function(){ var confirmed = []; for (i=0; i<active_boxes.length; i++){ confirmed.push(active_boxes[ i ].id_num); } console.log(confirmed); xhr.open("POST", "http://localhost:8000/", true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.send(c=confirmed); console.log("{{ request.session.keys }}") console.log("{{ request.session.values }}") var tester = parse_session_keys("{{ request.session.keys }}"); console.log(tester); solve_crossword(tester); }}; -
Django Wizard Form, Lost Values in preview steps
I am using a django formtools. I have two forms, first form called PersonalData and second form called Reference. When I fill the first form(PersonalData), I press button submit and go to the second forms. I fill the second form(Reference), but I press the button prev step, and return the first form, but the textbox and another ui is empty. How to re fill the first step? -
MySQL procedure execution results
Convert text to json using procedure When executing a procedure in the workbench, the following is entered : {"data1" : "8192","data2" : "30"} When running a procedure in django, the following is entered : {"data1" : "8192 ","data2" : "30} django(pymysql) code: try: cursor.callproc("convertData", [chk_id, var_data, sta_data]) cursor.fetchall() finally: cursor.close() return HttpResponseRedirect(success_url) Is there an input method without line breaks? -
Django Creating A Dynamic XML Sitemap That Updates Every Day
How do I implement a dynamic sitemap in Django that updates itself based on newly added courses and lessons as well as all other static links? The dynamic links that constantly get added or edited from admin are courses and lessons slugs are using this format: domain.com/courses/courses/course_slug/lesson_slug Directory Structure: https://imgur.com/a/eG3JlXE https://imgur.com/a/mZDeIf6 https://imgur.com/a/mm9W1G3 Updated Memberships urls.py: https://dpaste.de/mT0d Updated Courses urls.py code: https://dpaste.de/6d54 Updated Project settings.py and urls.py: https://dpaste.de/KpCc All other code: https://github.com/danialbagheri/video-membership Here are all of the static links: / /courses/ /about/ /contact/ /memberships/ /memberships/profile/ /termsofservice/ /privacypolicy/ /memberships/payment/ And all of the allauth ones. I tried following some youtube videos here but I am still completely lost. I would appreciate any help with this. -
Httpresponse redirect exception not catching error
I have a phone verification system I coded today but the last step in the process is not working. When the wrong passcode is entered by the user it should throw a ValueError but the except statement I have is not catching the error. class PhoneVerifyView(LoginRequiredMixin, SuccessMessageMixin, FormView): form_class = PhoneVerifyForm template_name = 'phone_verify/phoneverification.html' success_url = reverse_lazy('overview') success_message = 'You have successfully verified your phone number!' def form_valid(self, form): employee = self.request.user user_input = form.cleaned_data['passcode'] phone_verify = get_object_or_404(PhoneVerify, employee=employee) try: if user_input == phone_verify.passcode: phone_verify.verified = True phone_verify.save() return super(PhoneVerifyView, self).form_valid(form) except ValueError: return HttpResponseRedirect(reverse_lazy('overview')) ValueError at /phone_verify/ The view phone_verify.views.PhoneVerifyView didn't return an HttpResponse object. It returned None instead. Thoughts on why this except statement is not working? -
How to limit text inside a div
I currently have a todo website, and on the home screen I display events in a div. However, when there is a really long title it overflows. Currently I have the x overflow hidden. How would I make it so it would add a ... at the end? I tried text-overflow: ellipsis, but that doesn't seem to help. Code that displays events: <div class="col-md-6 inline mb-4"> <h3 class="ml-1">Events:</h3> <div class="events-content-section ml-2"> {% for event in events %} <div class="mb-2" style="display: flex; align-items: center;"> <button type="button" class="view-event btn btn-light" style="width: 100%;" data-id="{% url 'view-event' event.pk %}"> <span> <h4 style="float: left;">{{ event.title }}</h4> <button type="button" class="update-event btn btn-sm btn-info ml-1" data-id="{% url 'update-event' event.pk %}" style="float: right;"> <span class="fas fa-edit"></span> </button> <button type="button" class="delete-event btn btn-sm btn-danger mr-2 ml-2" data-id="{% url 'delete-event' event.pk %}" style="float: right;"> <span class="fa fa-trash"></span> </button> </span> </button> </div> {% endfor %} </div> </div> css for div .events-content-section { background: #f5f5f5; padding: 10px 20px; border: 3px solid #dddddd; border-radius: 3px; overflow-y: auto; overflow-x: hidden; text-overflow: ellipsis; height: 400px; } -
Bootstrap datepicker + Django + Docker not working
I am running into a strange problem that I have tried debugging without success. I am using the django-bootstrap-datepicker-plus library to render datepickers on certain fields on my Django forms, and they appear correctly in dev (locally) however, they do not appear when I run them in a docker setup. I have include_jquery set to True in settings, and I am not loading any other jquery files. Any suggestions? local: docker: -
Failed to query Elasticsearch using : TransportErrorr(400, 'parsing_exception')
I have been trying to get the Elasticsearch to work in a Django application. It has been a problem because of the mess of compatibility considerations this apparently involves. I follow the recommendations, but still get an error when I actually perform a search. Here is what I have Django==2.1.7 Django-Haystack==2.5.1 Elasticsearch(django)==1.7.0 Elasticsearch(Linux app)==5.0.1 There is also DjangoCMS==3.7 and aldryn-search=1.0.1, but I am not sure how relevant those are. Here is the error I get when I submit a search query via the basic text form. GET /videos/modelresult/_search?_source=true [status:400 request:0.001s] Failed to query Elasticsearch using '(video)': TransportError(400, 'parsing_exception') Traceback (most recent call last): File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/haystack/backends/elasticsearch_backend.py", line 524, in search _source=True) File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped return func(*args, params=params, **kwargs) File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/client/__init__.py", line 527, in search doc_type, '_search'), params=params, body=body) File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/transport.py", line 307, in perform_request status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout) File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 93, in perform_request self._raise_error(response.status, raw_data) File "/home/user-name/miniconda3/envs/project-web/lib/python3.7/site-packages/elasticsearch/connection/base.py", line 105, in _raise_error raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info) elasticsearch.exceptions.RequestError: TransportError(400, 'parsing_exception') Could someone tell me if this is an issue with compatibility or is there something else going on? How can I fix it?