Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to use bokeh-server (server_document) behind nginx, with django, on docker?
I'm Dockerising a Django app that serves a graph to users via bokeh server. I have split it into 3 main containers (on an Ubuntu host). (There are some DB containers too, but they're not the issue). These are 'webapp', 'serverapp', and 'nginx'. Using docker compose I can spin these up and hit them via localhost:port, and they all run as they should. Where I'm having difficulty is routing bokeh.server_document requests from 'webapp' to 'serverapp'. This is currently handled in django views: webapp/subapp/views.py def graphview(request, pk): """ Returns the view of requested graph """ script = server_document(url='serverapp';, arguments={"pk":pk,}, ) foo = Foo.objects.get(pk=pk) return render(request, 'graphview.html', {'script':script, 'foo':foo}) Which is rendered in this template: webapp/subapp/graphview.html <head> <script type = "text/javascript" src = "https://cdn.pydata.org./bokeh/release/bokeh-2.0.1.min.js"> </script> <script type = "text/javascript" src = "https://cdn.pydata.org./bokeh/release/bokeh-widgets-2.0.1.min.js"> </script> <script type = "text/javascript" src = "https://cdn.pydata.org./bokeh/release/bokeh-tables-2.0.1.min.js"> </script> </head> <div id="graphviewDisplay"> {% if user.is_authenticated %} {{script | safe}} {% else %} <p> You must be signed-in to see this content </p> {% endif %} </div> and accessible via this url pattern webapp/subapp/urls.py from django.urls import path from subapp import views urlpatterns = [ path('graphview/<int:pk>', views.graphview, name='graphview'), ] Over on 'serverapp' I have the basic bokeh server image (FROM continuumio/miniconda3) … -
Getting this error13 in django while using apache2 server
PermissionError at /upload/ [Errno 13] Permission denied: 'media/Ravi.pdf' Traceback (most recent call last): File "/home/rekrutbot/Documents/project2/resumeparser/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/rekrutbot/Documents/project2/resumeparser/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/rekrutbot/Documents/project2/resumeparser/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/rekrutbot/Documents/project2/resumeparser/venv/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view return view_func(request, *args, **kwargs) File "/home/rekrutbot/Documents/project2/resumeparser/start/views.py", line 126, in upload handle_uploaded_file(file, file.name, file.content_type) File "/home/rekrutbot/Documents/project2/resumeparser/start/views.py", line 98, in handle_uploaded_file fo = open("media/" + str(name), "wb+") Exception Type: PermissionError at /upload/ Exception Value: [Errno 13] Permission denied: 'media/Ravi.pdf' -
How can I make a Django REST register/login routes available for Postman
I have a simple Django app with a model called Person: class Person(models.Model): user = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE ) birthday = models.DateField(null=True) gender = models.CharField(max_length=10) height = models.CharField(max_length=3) weight = models.CharField(max_length=3) I have also a User -model like this: from django.contrib.auth.models import AbstractUser class CustomUser(AbstractUser): pass # add additional fields in here def __str__(self): return self.username I can log in in the admin panel and create new users from there and link my Person -model with a User. What I'm wondering is how can I define for example register/ and login/ routes so I could for example register a new user with Postman? How about authentication, could someone give a simple example how to serve right data to right users? -
Instance on Django is not working, except for picture field
Would you know why Django instance is not working properly in my code below? The idea is to allow the user to edit their articles (called seed in my code) and to do so it's more convenient for them to access the data from the current article. But for some reason, the form stays empty, except the picture field, no matter what. So I was wondering if some part of my code was canceling this instance. Thank you for any help!! views.py def seed_edit(request, slug): to_edit_seed = Seed.objects.get(slug=slug) if to_edit_seed.user.id != request.user.id: return render(request, 'dist/inside/knowledge/404_not_allowed.html') else: if request.method == 'POST': seed_form_edit = SeedForm(request.POST, request.FILES, instance=to_edit_seed) seed_vc_edit = SeedFormVC(request.POST) if seed_form_edit.is_valid() and seed_vc_edit.is_valid(): seed = seed_form_edit.save(commit=False) seed.save() seed_form_edit.save_m2m() if Value_Chain_Seed.objects.filter(seed_id=to_edit_seed.id).exists(): f = Value_Chain_Seed.objects.filter(seed_id=to_edit_seed.id) f.delete() seed_vc_edit.instance.seed = to_edit_seed seed_vc_edit.save() else: seed_vc_edit.instance.seed = to_edit_seed seed_vc_edit.save() messages.success(request,'Your seed was successfully updated!') return redirect(reverse(("knowledge:one_seed"),args=[to_edit_seed.slug])) else: seed_form_edit = SeedForm(request.POST, request.FILES, instance=to_edit_seed) seed_vc_edit = SeedFormVC(request.POST) else: seed_form_edit = SeedForm(request.POST, request.FILES, instance=to_edit_seed) seed_vc_edit = SeedFormVC(request.POST) return render(request, 'dist/inside/knowledge/seed/edit_seed.html', { 'to_edit_seed': to_edit_seed, 'seed_form_edit': seed_form_edit, 'seed_vc_edit': seed_vc_edit, }) form.py class SeedForm(forms.ModelForm): sdg = forms.ModelMultipleChoiceField( queryset=SDG.objects.all().exclude(id=18), widget=forms.CheckboxSelectMultiple, ) industry = forms.ModelMultipleChoiceField( queryset=Industry.objects.all().exclude(id=10), widget=forms.CheckboxSelectMultiple, ) class Meta: model = Seed fields = ["title", "profile_seed","aim_seed", "keywords"] template <div class="row mx-n2"> <form method="post" class="post-form" … -
'OrderItem' object has no attribute 'Product'
app is runing good but when i try to add some items into add item through admin panel then I got this error meanwhile I have add product in my model. error says: AttributeError at /admin/store/orderitem/add/ 'OrderItem' object has no attribute 'Product' code of add item model: class OrderItem(models.Model): product = models.ForeignKey(Product, on_delete=models.SET_NULL, blank=True, null=True) order = models.ForeignKey(Order, on_delete=models.SET_NULL, blank=True, null=True) quantity = models.IntegerField(default=0, null=True, blank=True) date_added = models.DateTimeField(auto_now_add=True) def __str__(self): return self.Product.name -
Why doesn't Django serve static files when the dubug=False in settings?
when I tried to run the project, static files are missing, and the settings.debug is set to False. -
Is there a way of writting css that targets links in a summernote?
i need to open my links in a new tab, but those links are in a summer note page, they are in the metadata, not programmed directly. any idea would be highly appreciated. -
Domain in checkout view to enable payments in production environment with Stripe and Django
I have a question, what domain url I should include in the code below to make payments possible in production environment. When I include link to the development website it works on development server (and does not work on the production server), but when I provide the website address related to the production server it doesn't work. What address local/production I should include to make it work? ' @csrf_exempt def create_checkout_session(request): if request.method == 'GET': domain_url = '..........' stripe.api_key = STRIPE_SECRET_KEY try: checkout_session = stripe.checkout.Session.create( client_reference_id=request.user.id if request.user.is_authenti$ success_url=domain_url + '/success?session_id={CHECKOUT_SESSION$ cancel_url=domain_url + '/cancel/', payment_method_types=['card'], mode='subscription', line_items=[ { 'price': STRIPE_PRICE_ID, 'quantity': 1, } ] ) return JsonResponse({'sessionId': checkout_session['id']}) except Exception as e: return JsonResponse({'error': str(e)}) ' -
django return link username in model
I know it's not true what's in the code how i can return the usernames that the api is linked to To view in the admin page from django.db import models from django.contrib.auth.models import User class api(models.Model): user = models.ManyToManyField(User) api_key = models.CharField(max_length=120) def __str__(self): return f"api key for: {self.user.username}" -
(2027, 'Malformed packet')
I am using Django with RDS along with Aptible deployement. I started receiving lots (2027, 'Malformed packet') for a while but when I run the same query using Django "shell" OR "dbshell" then the query works fine. I am not able to find any lead around that, found some articles/answers but now one could help. -
Why user permissions are not showing in Django Rest Framework?
I am creating a group, added permissions to that group and assigning that group to a user (as shown in below code): new_group, created = Group.objects.get_or_create(name=grp_name) permission_obj = Permission.objects.get(name=permission) new_group.permissions.add(permission_obj) user.groups.add(new_group) This code works properly but in admin interface the 'user permissions' section is not showing added group permissions -
Pytest new errors connecting to test database
I am running into strange errors I have never seen before on CircleCi where I am running my tests and nearly all are erroring out due to not being allowed to access the database. This is a new error that did not occur last week so I am hesitant to say it is a code change, and it does not happen when I run pyest locally. Here is the error: conftest.py:52: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.8/site-packages/django/db/models/query.py:287: in __iter__ self._fetch_all() /usr/local/lib/python3.8/site-packages/cacheops/query.py:271: in _fetch_all return self._no_monkey._fetch_all(self) /usr/local/lib/python3.8/site-packages/django/db/models/query.py:1308: in _fetch_all self._result_cache = list(self._iterable_class(self)) /usr/local/lib/python3.8/site-packages/django/db/models/query.py:53: in __iter__ results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) /usr/local/lib/python3.8/site-packages/django/db/models/sql/compiler.py:1154: in execute_sql cursor = self.connection.cursor() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <django.test.testcases._DatabaseFailure object at 0x7fb361b2d2b0> def __call__(self): > raise AssertionError(self.message) E AssertionError: Database queries to 'test' are not allowed in … -
convert SQL Query to django query?
i want to transform this sql query to django query : profs = django model I tried many times but i can't do it , please help SQL QUERY: select count(distinct prof_id) from profs WHERE "type"='m' and DATE_TRUNC('day',date_updated) > CURRENT_DATE - interval '30 day' -
How to save primary key as a reference
I am creating a Django app. I want the pk of the user who logs in to be saved in the variable userpk. Even though I log in a user, the value of userpk remains 'None'. What am I doing wrong? views.py from django.shortcuts import render, redirect, get_object_or_404 from .models import * userpk = None def login(request): if request.method == 'POST': username = request.POST.get('username') password = request.POST.get('password') try: account = Account.objects.get(username=username) except: return render(request, 'MyApp/login.html') if password == account.password: account.pk = userpk return redirect(f'view_wine/?acc={account.pk}') else: return render(request, 'MyApp/login.html') else: return render(request, 'MyApp/login.html') The accounts' data are stored in the Account model: models.py class Account(models.Model): username = models.CharField(max_length=20) password = models.CharField(max_length=20) objects = models.Manager() def getUsername(self): return self.username def getPassword(self): return self.password def __str__(self): return str(self.pk) + ": " + self.username + ": " + self.password -
Send email with django and AWS SES signature V4
I have a django project and recived an email informing that I should change my ses signature from v2 to v4. I created a new IAM user following this tutorial https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html and attach this politics: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ses:*" ], "Resource": "*" } ] } I´m using this lib https://pypi.org/project/django-ses/, but got this erro message "An error occurred (SignatureDoesNotMatch) when calling the GetSendQuota operation: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details." Someone can help to send an email? -
EmptyPage at / That page contains no results
Iam getting this error when Iam trying to navigate to the last page how shall I solve it? Nad Iam a self taught programmer this is really stopping me to learn to code Please help me to deal with this error. This is my home.html: {%extends "blog/base.html"%} {%block content%} {%for post in posts%} <article class="media content-section"> <img class = "rounded-circle aritcle-img" height = 80px width = 80px src="{{ post.author.profile.image.url }}" alt=""> <div class="media-body"> <div class="article-metadata"> <a class="mr-2" href="{% url 'post-posts' post.author.username%}">{{ post.author }}</a> <small class="text-muted">{{ post.date_posted|date:"F d, Y" }}</small> </div> <h2><a class="article-title" href="{% url 'post-detail' post.id %}" >{{ post.title }}</a></h2> <p class="article-content">{{ post.content }}</p> </div> </article> {%endfor%} {% if is_paginated%} {% if page_obj.has_previous %} <a class = 'btn btn-outline-info mb-4' href="?page=1">First</a> <a class = 'btn btn-outline-info mb-4' href="?page={{ page_obj.previous_page_number}}">Previous</a> {% endif %} {% for num in page_obj.paginator.page_range %} {%if page_obj.number == num %} <a class = 'btn btn-info mb-4' href="?page={{ num }}">{{ num }}</a> {%elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %} <a class = 'btn btn-outline-info mb-4' href="?page={{ num }}">{{ num }}</a> {%endif%} {% endfor %} {% if page_obj.has_previous %} <a class = 'btn btn-outline-info mb-4' href="?page={{ page_obj.next_page_number }}">Next</a> <a class = 'btn btn-outline-info mb-4' href="?page={{ page_obj.paginator.num_pages }}">Last</a> … -
Javascript can't parse the json properly
I'm trying to parse json with xhr. I've done xhr file for two pages and every page takes different data from xhr file. If the parser can't find the proper id in html template it can't handle the remaining part. Here's js const xhr = new XMLHttpRequest() method = 'GET' xhr.responseType = 'json' function buildTable(data){ } xhr.open(method, requestURL) xhr.onload = function() { if (xhr.status > 400){ console.error(xhr.error) }else{ console.log(xhr.response) document.getElementById('name').innerHTML = xhr.response.name document.getElementById('status').innerHTML = xhr.response.status .... buildTable(xhr.response.history) document.getElementById('description').innerHTML = xhr.response.description } } xhr.send() and here's the django template {% extends 'base_dashboard.html' %} <div class="wrapper"> {% include 'sidebar.html' %} <div id='name'></div> <div class="" id="status">In Progress</div> <div class="col-xs-12" id='description'></div> </div> {% load static %} <script src="{% static '/js/xhr_dashboard.js' %}"> </script> {% endblock content %} JSON example name: "myname" description: "This is the test description" status: "2" -
Save Django forms from 2 different models into third model
I new-ish to Django and need some help with Django Forms. I'm building a poll like app to learn, but I would like to have the poll questions come from one model, while the answer choices from other model. However I have issues getting that data back to the CBV using forms. class RiderModel(models.Model): full_name = models.CharField(max_length=500) number = models.IntegerField() def __str__(self): return self.full_name class QuestionModel(models.Model): category = models.ForeignKey(CategoryModel, on_delete=models.CASCADE, default=1) question_text = models.TextField() def __str__(self): return self.question_text class UserVoteModel(models.Model): user = models.OneToOneField(get_user_model(), on_delete=models.CASCADE) event = models.ForeignKey(GameModel, on_delete=models.CASCADE) question = models.ForeignKey(QuestionModel, on_delete=models.CASCADE) answer = models.ForeignKey(RiderModel, on_delete=models.CASCADE) In the CBV I have this function to get the data to template, but not sure how to get this data back into the UserVoteModel def get_queryset(self): event = self.kwargs['short_name'] category = GameModel.objects.filter(short_name__iexact=event)[0].question_category return {'questions': QuestionModel.objects.filter(category=category), 'riders': RiderModel.objects.all()} Thank you in advance for your help. -
{"message":["This field is required."],"status_code":400} error when posting requests in python to a Django rest framework
Hi I have a code to post json data to a url but I am getting {"message":["This field is required."],"status_code":400} this as response. Even though i have no message fields in my code or data. import requests import json from urllib3.exceptions import InsecureRequestWarning refreshurl = "/api/login" refreshheader = { "accept": "application/json", "content-type": "application/json", } refreshfields = { "username": " ", "password": " " } #api call for refresh token access_token_response = requests.post(refreshurl, headers=refreshheader, json=refreshfields, verify=False) myaccesstoken = access_token_response.json()["access"] #api call for accesstoken url2 = "https://google.com/upload_data" #dummy url header2 = { "accept": "application/json", "content-type": "application/json", "Authorization": "Bearer {}".format(myaccesstoken)", } fields = { { "name":"alia","id":"GSHBA678","status":"active","zipcode":56839}, } #api call to upload data requests.packages.urllib3.disable.warnings(category=InsecureRequestWarning) response = requests.post(url2, headers=header2, json=fields, verify=False) print(response.text) print(response.status_code) Instead of Bearer if i put token in JWT it is giving me {"message":["Authentication credentials were not provided"],"status_code":401}. I have no idea how to solve this. Any help would be appreciated. Thanks . -
How can I optimize the function given below so that number of hits to the database are reduced?
I have this function def get_lesson_posts(self): learning_units = self.get_learning_units() comments = [] for unit in learning_units: if unit.lesson is not None: lesson_ct = ContentType.objects.get_for_model(unit.lesson) title = unit.lesson.name try: post = Post.objects.get( target_ct=lesson_ct, target_id=unit.lesson.id, active=True, title=title ) except Post.DoesNotExist: post = None if post is not None: comments.append(post) return comments There is a for loop iterating on each unit and creating a content type object (lesson_ct) which is then used to get a post from the Post table. Now I think on each iteration a database query is executed by the Post model to get a post object. The problem is I am not able to think of a better method to get the Post object without making queries on each iteration. I need help in writing the function properly so that I can reduce the number of queries being executed. For reference I am posting the Post model and Lesson Model below. class Post(ForumBase): title = models.CharField(max_length=200) target_ct = models.ForeignKey(ContentType, blank=True, null=True, related_name='target_obj', on_delete=models.CASCADE) target_id = models.PositiveIntegerField(null=True, blank=True, db_index=True) target = GenericForeignKey('target_ct', 'target_id') class Lesson(models.Model): # Lesson name name = models.CharField(max_length=255) # Markdown text of lesson content description = models.TextField() Please tell me if more information is required. Thanks -
502 Gateway Error + cannot detect my postgres
I am trying to docker up my django application using this tutorial. https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/ Technically, I have 2 problems: Cannot connect to the database 502 gateway error Everything seems to work until i get this error: nginx-proxy | nginx.1 *1 connect() failed (111: Connection refused) while connecting to upstream, client: 138.75.155.194, server: www.hello.com, request: "GET /favicon.ico HTTP/2.0", upstream: "http://172.25.0.2:8000/favicon.ico", host: "www.hello.com", referrer: "https://www.hello.com/" Also, it seems that my web server is unable to detect my postgresql database as it prompts a "waiting for postgres" due to the entrypoint.sh i have provided. I have configured my database using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-20-04 Been stuck with this for a few days! I will attach my code here: When I run netstat plant: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 637/systemd-resolve tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 840/sshd tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 27204/postgres tcp 0 0 127.0.0.1:35449 0.0.0.0:* LISTEN 19618/containerd tcp 0 0 174.138.34.252:22 138.75.155.194:52289 ESTABLISHED 740/sshd: root@nott tcp 0 1080 174.138.34.252:22 222.186.30.112:13146 ESTABLISHED 16139/sshd: [accept tcp 0 356 174.138.34.252:22 138.75.155.194:52288 ESTABLISHED 32641/sshd: root@pt tcp6 0 0 :::22 :::* LISTEN 840/sshd docker-compose file: version: '3.8' services: web: container_name: tinkertinc build: context: ./hello_main dockerfile: Dockerfile.prod … -
Including Modified Django Package in Project
I am trying to figure out how to include a modified package into a Django 2.2 project. The package has been modified. A few skins have been added to the editor. That is, it is no longer the same package that is installed when one does pip install <package>. My understanding is that it now needs to be added to source control and probably added to the project directory, instead of being located within a virtual environment's directory. The question is what is the way go about this situation most efficiently. Should I add the package to the project's directory or is there a way to somehow manage this through pip and requirements.txt? -
How to add two views in same urls in Djnago?
I'm Using Django framework as a backend, PostgresSQL for DB and HTML, CSS, Javascript for frontend. I am making a website and function like down below. User click to add the product (click on button "choose product")(Index.html) User directed to next page (listitem.html) where user can select the product. After choosing product from (listitem.html) (click on button "Add product") After that user redirected to main page which is (index.html) and the choosen product as shown to user. Now all the codes work fine. The data is fetched properly but not on the page what I wanted too. The Codes Goes here: urls.py urlpatterns = [ path('base/', views.base, name='base'), path('index/', views.build, name='index'), path("add-to-cart-<int:pro_id>/", AddToCartView.as_view(), name="addtocart"), path("my-cart/", MyCartView.as_view(), name="mycart"), ] views.py class AddToCartView(TemplateView): template_name = "status.html" def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) # get product id from requested url product_id = self.kwargs['pro_id'] # get product product_obj = Product.objects.get(id = product_id) # check if cart exists cart_id = self.request.session.get("cart_id", None) if cart_id: cart_obj = Cart.objects.get(id = cart_id) this_product_in_cart = cart_obj.cartproduct_set.filter(product = product_obj) if this_product_in_cart.exists(): cartproduct = this_product_in_cart.last() cartproduct.quantity += 1 cartproduct.save() cart_obj.save() else: cartproduct = CartProduct.objects.create(cart = cart_obj, product = product_obj, quantity = 1) cart_obj.save() else: cart_obj = Cart.objects.create(total=0) self.request.session['cart_id'] = cart_obj.id cartproduct … -
Django - Sitemap - Manually set absolute urls
I'm generating a sitemap but the website that this sitemap is for has a different URL routing and a different domain. I thought that overriding location method will work but the problem is that Django automatically adds Site url before each url. http://example.comhttps://thewebsite.com... <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url><loc>http://example.comhttps://thewebsite.com/article/123/slug</loc><lastmod>2021-05-10</lastmod> <changefreq>hourly</changefreq><priority>0.5</priority> </url> </urlset> class WebsiteSitemap(Sitemap): changefreq = "hourly" priority = 0.5 def items(self) -> typing.List: items = [] items.extend(Article.objects.home()) return items def location(self, obj: typing.Union[Article]): return obj.website_full_url def lastmod(self, obj: typing.Union[Article]) -> datetime: return obj.modified Is there a way to tell Django not to build the URL automatically? -
I am not able to use RemBg Python Software. Help me
I was using RemBg Software provided in this Repository. Whenever I used it. It gives me the following error- Failed to import ahead-of-time-compiled modules. This is expected on first import. Compiling modules and trying again. This might take a minute. Traceback (most recent call last): File "c:\python39\lib\site-packages\pymatting_aot\cc.py", line 36, in <module> import pymatting_aot.aot ModuleNotFoundError: No module named 'pymatting_aot.aot' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Python39\Scripts\rembg-server.exe\__main__.py", line 4, in <module> File "c:\python39\lib\site-packages\rembg\cmd\server.py", line 11, in <module> from ..bg import remove File "c:\python39\lib\site-packages\rembg\bg.py", line 6, in <module> from pymatting.alpha.estimate_alpha_cf import estimate_alpha_cf File "c:\python39\lib\site-packages\pymatting\__init__.py", line 2, in <module> import pymatting_aot.cc File "c:\python39\lib\site-packages\pymatting_aot\cc.py", line 54, in <module> compile_modules() File "c:\python39\lib\site-packages\pymatting_aot\cc.py", line 8, in compile_modules cc = CC("aot") File "c:\python39\lib\site-packages\numba\pycc\cc.py", line 65, in __init__ self._toolchain = Toolchain() File "c:\python39\lib\site-packages\numba\pycc\platform.py", line 78, in __init__ self._raise_external_compiler_error() File "c:\python39\lib\site-packages\numba\pycc\platform.py", line 121, in _raise_external_compiler_error raise RuntimeError(msg) RuntimeError: Attempted to compile AOT function without the compiler used by `numpy.distutils` present. Cannot find suitable msvc. I also tried to start their server by using the rembg-server command but it still not works. Can anybody …