Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How do I batch update a field with a function in Django
How do I batch update a field with a function in Django and The function argument is the field value . such as Data.objects.filter(need_add=1).update(need_add=Myfunc(F('need_add'))) -
How to fade out Django success messages using Javascript?
I am trying to fade out Django success messages using a small Javascript script but cannot seem to get it to work. This is in my base.html: {% if messages %} {% for message in messages %} <div class="alert alert-{{ message.tags }}"> {{ message }} </div> {% endfor %} {% endif %} <script> var m = document.getElementsByClassName("alert"); setTimeout(function(){ m.style.display = "none"; }, 3000); </script> -
Cant run django server because of cx_oracle
i pull my friend code in github , and when i want to run it with django *path*>workon test (test)*path*>py manage.py runserver it has error in it Traceback (most recent call last): File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\backends\oracle\base.py", line 47, in <module> import cx_Oracle as Database ModuleNotFoundError: No module named 'cx_Oracle' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\users\u532246\appdata\local\programs\python\python38-32\Lib\threading.py", line 932, in _bootstrap_inner self.run() File "c:\users\u532246\appdata\local\programs\python\python38-32\Lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\Users\u532246\Envs\test\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper fn(*args, **kwargs) File "C:\Users\u532246\Envs\test\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "C:\Users\u532246\Envs\test\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception raise _exception[1] File "C:\Users\u532246\Envs\test\lib\site-packages\django\core\management\__init__.py", line 337, in execute autoreload.check_errors(django.setup)() File "C:\Users\u532246\Envs\test\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper fn(*args, **kwargs) File "C:\Users\u532246\Envs\test\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Users\u532246\Envs\test\lib\site-packages\django\apps\registry.py", line 114, in populate app_config.import_models() File "C:\Users\u532246\Envs\test\lib\site-packages\django\apps\config.py", line 211, in import_models self.models_module = import_module(models_module_name) File "C:\Users\u532246\Envs\test\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Users\u532246\Desktop\skripsi\Django-master\polls\models.py", line 6, in <module> class Question(models.Model): File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\models\base.py", line … -
React + Firebase + Python
I have one project that I want to write in React frontend and Firebase as a database. But I need to write some functions with Python, I have some operations with ssh, valve, and FTP. Should I use Django? How to grab data that comes from Python libraries live like from base? What do you recommend? Btw, I never user Python with Firebase and I have struggles. -
Using bootswatch with Django Dojo
I am working on an app that uses Django + Dojo. I want the UX to have awesome fonts, bootswatch kind of themes for example https://bootswatch.com/3/cosmo/ The entire app is going to be written in python and want to understand how I can ensure I get the modern look interface rather than the arcane Microsoft UI like feel some of the older dojo widgets spit out. -
upload_to category folder based on ForeignKey
I have an Image model where I can upload images and assign them a foreign key. I want to use the ImageField's upload_to parameter and put them in the corresponding folder when uploaded. model.py class Image(models.Model): category = models.ForeignKey(Category, on_delete="CASCADE") image = models.ImageField(upload_to=str(category.name)) caption = models.CharField(max_length=250, blank=True) I'd Like to create the category folder on creation then uploat images to their foreign key's folder. -
OAuth2 with Vue and Django
I have a project with Vue Js + Django Rest Framework and i want to be able to login with Google. I all ready have the GoogleUser object with this code: <script> export default { name:'GoogleButton', mounted () { window.gapi.load('auth2', () => { const auth2 = window.gapi.auth2.init({ client_id: 'API_CLIENT.apps.googleusercontent.com', cookiepolicy: 'single_host_origin' }) auth2.attachClickHandler(this.$refs.signinBtn, {}, googleUser => { this.$emit('done', googleUser) }, error => console.log(error)) }) }, } </script> ( This code is just for testing the object and endpoint ) onSuccess(obj){ var usuario = obj.getBasicProfile() console.log("TEsting login" + usuario.getName()); var email = usuario.getEmail(); var data = { 'email':email, 'password':'********', } var url = 'http://localhost:8000/login/'; var paquete = { method:'POST', body:JSON.stringify(data), headers:{ 'Content-Type': 'application/json', } } fetch(url,paquete).then( res => res.json() ).catch( error => console.error('Error:', error) ).then(function(res){ console.log(res); }); } Now my question is... what can i do from the server's side to know if the data that was sent is actually from a Google user? Can i use the TokenId and "asking throw OAuth to Google is its ok" ? -
Getting the count of objects inside a django model related set (nested)
I have three models, each one has a 1:n relationship with the other, so coming from one model I would like the know the total count of all the children objects. I already have a working code (displayed below) in a function but I believe it can be done in a single query. class Carton(models.Model): id = models.CharField(max_length=15, primary_key=True) pallet = models.ForeignKey(Pallet, null=True, blank=True, on_delete=models.SET_NULL) # removed the other unrelated fields class Pallet(models.Model): id = models.CharField(max_length=15, primary_key=True) group = models.ForeignKey(PalletGroup, on_delete=models.CASCADE) # removed the other unrelated fields class PalletGroup(models.Model): id = models.UUIDField(default=uuid.uuid4, primary_key=True) # removed the other unrelated fields # THIS IS WHAT I THINK COULD BE DONE IN A SINGLE QUERY def total_assigned_cartons(self): total_assigned_cartons = 0 for pallet in self.pallet_set.all(): total_assigned_cartons += pallet.carton_set.count() return total_assigned_cartons I'm just trying to understand if it can be done in a single query instead of iterating over all the related objects and counting the total count for each. -
Can I return a template and a variable separately from a single Django function?
I am writing an ajax call. The call returns HTML. However, I only want to actually load the new HTML if a certain thing happened on the backend (either an insert or a delete action occurred). Thus, I want to return two variables from Django. (1) The html, that I will only load if the second variable (2) returns true or false. Although this won't be very useful, a sample function is below: def update_party_and_company_data(request): parties, companies, reload = get_the_data() context = {'parties': [list of parties], 'companies': [list of companies],} html = render(request, 'setup_parties_data.html', context) reload_instruction = reload return HttpResponse(json.dumps({'html': html , 'reload_instruction ': reload_instruction })) -
Django and jQuery, why?
I'm struggling to intuitively understand some basic concepts related to Django and jQuery. Surprisingly there is an equal struggle try to find a good curated answer. 1. Eg DataTables (a very common add-in ) Why do I need to use jQuery at all, why cannot I use python? 2. How do I connect JS with Python, as Python is needed to work with models? Do I need to take de-tour using JSON and serializers? Why don't a django version of DataTables exist, isn't django a pretty common framework? Is there a specific chapter in a book, a video, a blog, article, udemy that can bring me from zero to hero when it comes to Django and Datatables? Documentation around DataTables is not accessible as a start point. Many thanks for some guidance along the road in a time of frustration. -
How to filter a column name that's a PK Django query set
Basically, I pass the column name via a pk into a view. Next, I want to filter a queryset by the column name equals TRUE, however, I am unsure how to do this. def ColumnNameView(request, column_name): table = Model.objects.filter(column_name=True) return render(request, template, {'table':table}) This does not work as I cannot use a string as column name. -
Callbacks not working for FileUpload plugin
So I'm trying to follow this tutorial https://simpleisbetterthancomplex.com/tutorial/2016/11/22/django-multiple-file-upload-using-ajax.html to try to implement file uploading capabilities for my own web app. However, when I get to the section about "Displaying the Progress" my modal is not shown. Any idea what I'm doing wrong? (Code is kinda copied almost word for word for testing purposes) HTML: {% extends 'qqq/main_template.html' %} {% load static %} {% block content %} <!-- Datatables provided styles and js code --> <link href="{% static 'qqq/vendor/datatables/dataTables.min.css' %}" rel="stylesheet"> <script src="{% static 'qqq/vendor/datatables/dataTables.min.js' %}"></script> <!-- Page level custom scripts --> <script type="text/javascript" src="{% static 'qqq/js/custom-datatable.js' %}"></script> <script src="{% static 'qqq/js/fileUpload/js/vendor/jquery.ui.widget.js' %}"></script> <script src="{% static 'qqq/js/fileUpload/js/jquery.iframe-transport.js' %}"></script> <script src="{% static 'qqq/js/fileUpload/js/jquery.fileupload.js' %}"></script> <!-- Maybe need to edit --> <script src="{% static 'qqq/js/basic-upload.js' %}"></script> <!-- Page Heading --> <h1 class="h3 mb-2 text-gray-800">Parse & Update</h1> <!-- <input type="file" multiple id="fileLoader" name="myfiles" title="Load File" /> <input class="btn btn-primary btn-lg" type="button" id="btnOpenFileDialog" value="Parse & Update" onclick="openfileDialog();" /> --> <!-- {# 1. BUTTON TO TRIGGER THE ACTION #} --> <div> <button type="button" class="btn btn-primary btn-lg js-upload-photos">Parse & Update</button> <input id="fileupload" type="file" name="file" multiple style="display: none;" data-url="{% url 'qqq:parse' %}" data-form-data='{"csrfmiddlewaretoken": "{{ csrf_token }}"}'> </div> <table id="gallery" class="table table-bordered"> <thead> <tr> <th>Logs</th> </tr> </thead> <tbody> {% … -
Django session matching query does not exit
I am trying to accept urls of the form "http://0.0.0.0:8000/sim_session/ABCD/EFGH/[0-9][0-9][0-9]/" via my django url patterns but I don't know why it cannot recognize "http://0.0.0.0:8000/sim_session/ABCD/EFGH/000/" or "http://0.0.0.0:8000/sim_session/ABCD/EFGH/311/" whereas, it accepts "http://0.0.0.0:8000/sim_session/ABCD/EFGH/010/" and "http://0.0.0.0:8000/sim_session/ABCD/EFGH/110/" Can someone help me how to accept 3 digits one after another via django url patterns? and also some explanation on why the above regex behaves unexpectedly would be much appreciated. I have also tried patterns like url(r'(?P < tutor_name>[^/]+)/(?P< tutee_name>[^/]+)/(?P< image_name>[\d]{3})/$', views.sim_session, name='room') but it does not work. Code snippet from django.conf.urls import url from . import views urlpatterns = [ url(r'(?P< tutor_name>[^/]+)/(?P< tutee_name>[^/]+)/(?P< image_name>[0-9][0-9][0-9])/$', views.sim_session, name='room') ] -
Accessing Django model fields throws NameError inside of dictionary
I'm trying to return a dictionary via DRF's Response(), but I can't access any model fields from within the dictionary. I tried returning a single field's value without first packing the data into a dictionary, and it worked. I know that Django's querysets are lazy and only hit the DB on evaluation, but I'm stumped by why my model suddenly has no fields when it's accessed inside of a dictionary. @api_view(['GET']) def arDetail(request): ''' gets data from model and puts it into a dict to be returned ''' model = model.objects.get(pk=int(request.GET["pk"])) #return Response(model.pk) WORKS here, but throws a nameerror #when accessed in rspData rspData = { pk: model.pk, problem: model.problem, solution: model.solution, primaryCategory: model.primaryCategory, secondaryCategory: model.secondaryCategory, profilePic: model.author.profilePic } return Response(rspData) I need to pull URLS and whatnot from other models, so I can't just use DRF's serializers as I do on my other models. What should happen is that I set each of the necessary fields in the dictionary and then return that with Response(), but I can't access model fields from within the rspData dictionary. Instead, Django throws a NameError on the first line of the dict, (and any others if I comment out fields to look for … -
How to use chrome to view a website that is locally hosted on a VPS (ssh)
Trying to view, with my windows desktop, a development server hosted locally on a VPS, via Chrome + SSH tunnel. VPS locally hosted port 8000 Trying to output tunnel on my windows to port 8080 (or any port that is safe idc) I can ssh just fine via cmd with ssh user@ip.com and I felt like this one might be close but I can't get it to work... ssh -L 127.0.0.1:8080:127.0.0.1:8000 myuser@myvps.com It holds the connection in the cmd line like it is "working" but when I navigate to 127.0.0.1:8080 and all I get is "This site can't be reached". -
How to fix modelformset error: __init__() missing 1 required positional argument: 'user'
This is my first attempt at using formsets and I am stuck with this error. Where am I going wrong? I don't fully understand how this works yet. I think my form is expecting a user but I don't know what to do with it. Thanks for any help! error: init() missing 1 required positional argument: 'user' model: class PropertySubmission(models.Model): BANNER_CHOICES = ( ('NB', 'No Banner'), ('FL', 'For Lease'), ('FS', 'For Sale'), ('NL', 'New Listing'), ('SD', 'Sold'), ('LD', 'Leased'), ('RD', 'Reduced'), ('NP', 'New Price'), ('SC', 'Sold Conditionally'), ('CB', 'Custom Banner'), ) image = models.ImageField(upload_to=user_directory_path, blank=True) mls_number = models.CharField(max_length=8, blank=True) headline = models.CharField(max_length=30) details = RichTextField() banner = models.CharField(max_length=2, choices=BANNER_CHOICES) author = models.ForeignKey(User, on_delete=models.CASCADE) date_posted = models.DateTimeField(default=timezone.now) date_modified = models.DateTimeField(default=timezone.now) program_code = models.ManyToManyField(Program) product = models.ForeignKey('Product', on_delete=models.SET_NULL, null=True) production_cycle = models.ManyToManyField('ProductionCycle') shell = models.ForeignKey('Shell', on_delete=models.SET_NULL, null=True) card_delivery_instructions = models.CharField(max_length=1000, blank=True) card_delivery_instructions_image = models.ImageField(upload_to=card_delivery_instructions_image_path, blank=True) form: class PropertyCreateKeepInTouchForm(forms.ModelForm): class Meta: model = PropertySubmission fields = ['headline','details','banner','image','mls_number','program_code'] help_texts = { 'details': '110 characters maximum', } def clean(self): cleaned_data = super().clean() image = cleaned_data.get("image") mls_number = cleaned_data.get("mls_number") program_code = cleaned_data.get("program_code") if mls_number == '' and image is None: # Only do something if one field are valid so far. self.add_error('image', 'Please provide an image … -
Django REST, serializing variable/multiple nested OnetoOne relationship
Apologies if the title is unclear as to what the issue is, I'm unsure how to describe it. I have a "parent" survey model which holds my general fields which all surveys have in common. class Survey(models.Model): ... However depending on the type of survey, additional/different fields are required class SurveyA(models.Model): survey = models.OneToOneField( Survey, on_delete=models.CASCADE, primary_key=True ) fieldA = models.TextField() class SurveyB(models.Model): survey = models.OneToOneField( Survey, on_delete=models.CASCADE, primary_key=True ) fieldC = models.TextField() class SurveyN(models.Model): survey = models.OneToOneField( Survey, on_delete=models.CASCADE, primary_key=True ) fieldN = models.TextField() When I serialize a "Survey" object into json, I would like the corresponding SurveryA,B..N object to be serialized along with it, regardless of which type of sub survey is related back in the OnetoOneField. Is this doable? Expected output when serializing all Survey models: [ { "id": 1, "SurveyA": { "fieldA": "this is an 'A' type Survey", } }, { "id": 2, "SurveyB": { "fieldB": "this is an 'B' type Survey", } }, { "id": 3, "SurveyN": { "fieldN": "this is an 'N' type Survey", } } ] -
Django category view
I am new to django and maybe this is a stupid question but i got stuck with this for a while now.. so i have a few categories of meds, like AINS, antidepressants and each of this category has its own meds, and i am trying to show my users all the meds of a specific category: so if a users types in www.namesite.com/meds/AINS the it will show only the meds for that specific category .. AINS.I think that i should get the absolute url of every category and filter all the meds in that specific category? -
Best way to handle one ForeignKey field that can be sourced from multiple Database Tables
I am running into a little bit of unique problem and wanted to see which solution fit best practice or if I was missing anything in my design. I have a model - it has a field on it that represents a metric. That metric is a foreign key to an object which can come from several database tables. Idea one: Multiple ForeignKey fields. I'll have the benefits of the cascade options, direct access to the foreign key model instance from MyModel, (although that's an easy property to add), and the related lookups. Pitfalls include needing to check an arbitrary number of fields on the model for a FK. Another is logic to make sure that only one FK field has a value at a given time (easy to check presave) although .update poses a problem. Then theres added space in the database from all of the columns, although that is less concerning. class MyModel(models.Model): source_one = models.ForeignKey( SourceOne, null=True, blank=True, on_delete=models.SET_NULL, db_index=True ) source_two = models.ForeignKey( SourceTwo, null=True, blank=True, on_delete=models.SET_NULL, db_index=True ) source_three = models.ForeignKey( SourceThree, null=True, blank=True, on_delete=models.SET_NULL, db_index=True ) Idea two: Store a source_id and source on the model. Biggest concern I have with this is needing … -
Error generating a django form with materialize
When I use a template to fill out a form I cannot use the checkboxes, because they come out as if they were disabled and I cannot select them and the password is not saved with a hash if not as simple text I have a form code with a user model with AbstractUser and signals to create multiple roles: class User(AbstractUser): is_administrator = models.BooleanField(default=False) is_satellite = models.BooleanField(default=False) def get_administrator(self): administrator = None if hasattr(self, 'administrator'): administrator = self.administrator return administrator def get_satellite(self): satellite = None if hasattr(self, 'satellite'): satelite = self.satellite return satellite def __str__(self): return '%s %s' % (self.first_name, self.last_name) class Meta: db_table = 'auth_user' class Administrator(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) business_name = models.CharField(max_length=30) class Satellite(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) business_name = models.CharField(max_length=30) @receiver(post_save, sender=settings.AUTH_USER_MODEL) def assign_role(sender, instance, **kwargs): if instance.is_administrator: administrator = Administrator(user=instance) administrator.save() elif instance.is_satellite: satellite = Satellite(user=instance) satellite.save() And the form is as follows: from django import forms from .models import ( User, ) class UserForm(forms.ModelForm): class Meta: model = User fields = ['username', 'first_name', 'last_name', 'email', 'password', 'is_active', 'is_administrator', 'is_satelite'] labels = { 'username': 'Username', 'first_name': 'Name', 'last_name': 'Surname', 'email': 'Email', 'password': 'Password', 'is_active': 'State', 'is_administrator': 'Administrator', 'is_satellite': 'Satellite', }, widgets = { 'username': … -
Django - Custom file/Image upload getting file path on upload ? process images on upload?
I have a Django app where users would upload Images and certain functions would take the image file path to process them and save the result in the same model. all of this would happen in the file upload view the problem is My functions take the file path which isn't created/committed in the DB yet as I don't save before calling those functions. I tried overriding the save method in the models.py and it didn't work so how can I call the functions after the upload in a convenient way ?? here's the function: # The view for analysing images def upload_view(request,pk=None): patient = get_object_or_404(Patient,pk=pk) if request.method == 'POST': form = forms.ImageForm(request.POST,request.FILES) if form.is_valid(): image = form.save(commit=False) image.patient = patient image.enhanced = main(image.original.path) image.segmented = segment(image.enhanced.path) image.enhanced.name = image.enhanced.path.split('media')[1] image.segmented.name = image.enhanced.path.split('media')[1] messages.success(request,"Image added successfully!") image.save() return HttpResponseRedirect(reverse_lazy('patients:patient_detail', kwargs={'pk' : image.patient.pk})) else: form = forms.ImageForm() return render(request, 'patients/upload.html', {'form': form}) else: form = forms.ImageForm() return render(request, 'patients/upload.html', {'form': form}) image.original is the uploaded image the problem is the file path isn't passed correctly and the functions return errors bec of that. (it worked when I made the processing in a different view where it was accessed after the upload) -
ordering self refrence model (workflow steps ordering)
I have a model that's representing a workflow process and another model representing the workflow steps as shown bellow: class Workflow(models.Model): title = models.CharField(max_length=254, null=True, blank=True) def __str__(self): return self.title class Step(models.Model): title = models.CharField(max_length=254, null=True, blank=True, verbose_name='Step name') workflow = models.ForeignKey(Workflow, on_delete=models.PROTECT, null=True, related_name='steps') next_step = models.ForeignKey('Step', on_delete=models.PROTECT, null=True) def __str__(self): return self.title How can I print the steps in order if the user can change the steps order anytime he wants? I was thinking of adding a priority field but this will forces the system to rearrange the steps every time the user insert a new step in the workflow. -
How to fix "TemplateDoesNotExist at /admin/login/ django/forms/widgets/text.html" error in Django??'
When i put : *python manage.py runserver* it woked but when i want to login in "http://127.0.0.1:8000/admin" it doesn't work . It gives me this message :strong text TemplateDoesNotExist at /admin/login/ django/forms/widgets/text.html , but i already created a superuser and i have django.contrib.admin installed in setting.py plz help me i've been wrking to solve this for about 1 week. -
Circular import on Django everytime I try to run project
So everytime I try to run my django project I get an error about circular import, I've seen a lot of similar things online but none seem to have helped. main urls: from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include('job_app.urls')) ] my views.py from django.shortcuts import render from django.views.generic import TemplateView # Create your views here. class BaseView(TemplateView): template_name = 'index.html' app urls from django.urls import path from .views import BaseView urlpatters = [ path('', BaseView.as_view(), name='baseview'), ] -
ImportError: cannot import name 'JSONField'
I'm getting the error: File "/home/mark/Nova/nova/lib/fields.py", line 1, in <module> from django.contrib.postgres.fields import JSONField ImportError: cannot import name 'JSONField' when I run python manage.py runserver 0.0.0.0:8888. Even though I already have simplejson installed. pip freeze shows, alabaster==0.7.12 Babel==2.7.0 bcdoc==0.16.0 boto3==0.0.21 botocore==1.0.0b3 certifi==2019.9.11 chardet==3.0.4 defusedxml==0.6.0 Django==1.8.2 django-bulk-update==1.1.4 django-cors-headers==2.0.2 django-facebook==6.0.3 django-pgjsonb==0.0.15 django-redis==4.2.0 django-revproxy==0.9.7 djangorestframework==3.1.3 djangorestframework-httpsignature==1.0.0 docutils==0.15.2 elasticsearch==1.6.0 facebook-sdk==1.0.0 filemagic==1.6 futures==2.2.0 geopy==1.11.0 google-api-python-client==1.5.0 httplib2==0.14.0 httpsig==1.3.0 idna==2.8 Jinja2==2.10.3 jmespath==0.7.1 MarkupSafe==1.1.1 mock==1.0.1 mongoengine==0.10.0 msgpack-python==0.5.6 nose==1.3.7 oauth2client==2.2.0 oauthlib==3.1.0 Pillow==2.8.2 psycopg2==2.8.4 py2neo==2.0.8 pyasn1==0.4.7 pyasn1-modules==0.2.7 pycryptodome==3.9.0 Pygments==2.4.2 PyJWT==1.7.1 pymongo==3.0.3 PySocks==1.7.1 python-dateutil==2.8.0 python-social-auth==0.2.10 python3-memcached==1.51 python3-openid==3.1.0 python3-pika==0.9.14 pytz==2019.3 redis==2.10.3 requests==2.2.1 requests-oauthlib==1.2.0 rsa==4.0 simplejson==3.7.3 six==1.12.0 snowballstemmer==2.0.0 Sphinx==1.3.1 sphinx-rtd-theme==0.1.9 sphinxcontrib-httpdomain==1.3.1 treelib==1.3.0 twilio==5.6.0 Unidecode==1.1.1 uritemplate==0.6 urllib3==1.10.1 What would be the fix for this?