Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django-Rest-FrameWork Post-Foreignkey
I am using DRF(Django-Rest-Framework) my Models.py class Followers(models.Model): id = models.AutoField(primary_key=True) followers_no = models.IntegerField() class Person(models.Model): followers = models.ForeignKey(Followers,null=True,blank=True,on_delete=models.CASCADE) name = models.CharField(max_length=120) age = models.IntegerField() def __str__(self) -> str: return self.name my serializers.py class Personserializer(ModelSerializer): followers = FollowerSerializer(read_only=True) class Meta: model = Person fields = "__all__" def validate(self,data): if data['age'] < 18: raise serializers.ValidationError('age should be more than 18') return data i want to add data about Person With Followers Field for that i create views.py def get(self, request): person_id = request.query_params.get('id') try: person = Person.objects.get(pk=person_id) except Exception as e: return Response({"status": False, "message": "Person not found"}, status=status.HTTP_404_NOT_FOUND) serializer = Personserializer(person) return Response({"status": True, "data": serializer.data}, status=status.HTTP_200_OK) def post(self, request): data = request.data serializer = Personserializer(data=data) if serializer.is_valid(): serializer.save() return Response({'status': True, "message": "Person created", "data": serializer.data}, status=status.HTTP_201_CREATED) return Response({"status": False, "message": "error", "error": serializer.error_messages}, status=status.HTTP_400_BAD_REQUEST) if i try to post data using postman as below { "followers": { "id": 1, "followers_no": 150 }, "name": "hello", "age": 19 } it shows as null value of followers instead if i pass the data it should post i Expect to store the data of followers field too -
Django delete record with ajax only disappears after manual refresh
I want to delete records from my table using Ajax and Sweetalert2 dialog. However, when I click the delete button and confirm the delete, the item is deleted from the modal but is still visible in the table. The element only disappears after a manual page refresh. I already reviewed many questions and videos but I think I'm missing some basic knowledge to identfy my issue.. html <tbody> {% if dogs %} {% for dog in dogs %} <tr> <td>{{ dog.dog_name }}</td> <td>{{ dog.gender }}</td> <td>{{ dog.breed }}</td> <td>{{ dog.size }}</td> <td>{{ dog.dob }} ({{dog.age}} Jahre)</td> <td>{{ dog.owner }}</td> <td>{{ dog.created_at }}</td> <td>{{ dog.updated_at }}</td> {% if dog.status == "ACTIVE"%} <td class="text-center"> <span class="badge text-bg-success" style="font-size:0.7em;">{{ dog.status }}</span> </td> {% elif service.status == "INACTIVE"%} <td class="text-center"> <span class="badge text-bg-danger" style="font-size:0.7em;">{{ dog.status }}</span> </td> {% endif %} {% if request.user.is_superuser == True %} <td class="text-center"> <!--Update--> <a href="{% url 'dog_record' dog.id %}" class="text-decoration-none"> <button type="button" class="btn btn-warning btn-sm" data-bs-toggle="tooltip" title="Update service"> <i class="bi bi-pencil-fill"></i> </button> </a> <!-- Delete --> <button type="button" class="btn btn-danger btn-sm DeleteButton" data-url="{% url 'delete_record' dog.id %}"> <i class="bi bi-trash"></i> </button> </td> {% endif %} </tr> {% endfor %} {% endif %} </tbody> </table> {% endblock %} {% β¦ -
Issue with Send mail by django.core.email import send_mail
I am trying to send a forget password email by send_mail in django. I am using gmail smtp with port 587. I have already made app password and 2 factor authentication. Problem is that I am recieving the email myself but if I send the email to someone who is not on my local network, the code doesn't throw any errors but they don't recieve any emails. I tried setting up an outbound rule in firewall settings but it is of no use. -
Django and sentry are not connected, Containers-to-containers connection
django, postgresql consists of docker-compose, and sentry consists each as a container while looking at the official document. Then, I created a new network (my_network) and connected django and sentry. However, issue tracking does not work. ps) It worked when django was turned locally instead of as a container. version: '3.8' volumes: postgres: driver: local redis: driver: local services: postgresql: image: postgres # build: ./.docker/postgresql volumes: - postgres:/var/lib/postgresql/data/ environment: POSTGRES_DB: aio_setting POSTGRES_USER: root POSTGRES_PASSWORD: aio0706! restart: unless-stopped ports: - '5432:5432' redis: # image: redis/redis-stack-server:latest image: "redis:alpine" restart: unless-stopped ports: - '6379:6379' volumes: - redis:/data app: build: . container_name: app command: /entrypoint.sh volumes: - .:/usr/src/app restart: unless-stopped ports: - "8000:8000" depends_on: - postgresql - redis import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration sentry_sdk.init( dsn="http://<secret>@my-sentry:8080/2", # dsn="http://<secret>@localhost:8080/2", # this worked when undockerizing integrations=[DjangoIntegration()] ) π docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES test_container cf5917ebf752 hubsettings-app "/entrypoint.sh" 2 hours ago Up 30 minutes 0.0.0.0:8000->8000/tcp app d096160bfd5d sentry "/entrypoint.sh run β¦" 2 hours ago Up 2 hours 0.0.0.0:8080->9000/tcp my-sentry 36aa3792c5b5 sentry "/entrypoint.sh run β¦" 2 hours ago Up 2 hours 9000/tcp sentry-worker-1 61906d23cab7 sentry "/entrypoint.sh run β¦" 2 hours ago Up 2 hours 9000/tcp sentry-cron 29d6b99e67c2 postgres "docker-entrypoint.sβ¦" 3 hours ago Up β¦ -
I can't access Django from Thonny or Python. Also sudo and apt-get don't work
I am trying to access Django. I installed using pip install django, but I can't access it in Thonny or Python. I tried using sudo, but I couldn't update it. I have version 1.0 of sudo, and apt-get doesn't work. I have tried many options to update sudo, but none of them have worked so far, but my biggest problem is being unable to access Django. -
Why won't Django load my CSS file with my HTML?
I am new to building django apps, and trying to add a simple CSS File to a simple HTML file for style points. I am not having any luck getting the CSS file to read into the HTML document on my web server. Can you please help me with this issue? my directory looks similar to this: web3/ βββ home1/ β βββ static/ β β βββ home1/ β β βββ style.css where home1 is the app, and I have my template for HTML in the first home1 folder (ie. home1/template/home1/home.html) Here is what I have in my html document: {% load static %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Kirby is the greatest</title> <!-- Link the CSS file --> {% load static %} <link rel="stylesheet" href="{% static 'home1/style.css'%}"> </head> <body> <h1>Great Job</h1> <h2>Proud</h2> </body> my views.py: `# home1/views.py from django.shortcuts import render from django.http import HttpResponse from django.template import loader def hello_world(request): return HttpResponse("you did it") def home(request): return render(request,"home1/home.html")' and the static portion of my settings.py: `# Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.0/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [ BASE_DIR / "home1/static", ] # Define the directory where 'collectstatic' will place all static files for production STATIC_ROOT β¦ -
How to add Locomotive in a django project?
connecting locomotive wiht django. Tried linking the classic way but didnt worked out as expected. below are the linked files: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/locomotive-scroll@3.5.4/dist/locomotive-scroll.css"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> <script src="{% static 'network/script.js' %}"></script> <script src="https://cdn.jsdelivr.net/npm/locomotive-scroll@3.5.4/dist/locomotive-scroll.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> <link href="{% static 'network/styles.css' %}" rel="stylesheet"> -
SuspiciousOperation - Attempted access to '%s' denied | Django
I uploaded my web app online. It contains a section that sends an audio file as input. Previously locally I used FileSystemStorage to store files in the "media/my_audio" path, but now that I've uploaded it to Google Cloud Platform I can't do that anymore. I have already configured everything, but I think there is some problem in my code. This is the code I tried to use: "settings.py" `PROJECT_ROOT = os.path.join(os.path.dirname(os.path.abspath(file)), os.pardir) DEFAULT_FILE_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage' STATICFILES_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage' GS_PROJECT_ID = 'my_id' GS_STATIC_BUCKET_NAME = 'my_STATIC_BUCKET_NAME' GS_MEDIA_BUCKET_NAME = 'my_MEDIA_BUCKET_NAME' # same as STATIC BUCKET if using single bucket both for static and media STATIC_URL = 'https://storage.googleapis.com/{}/'.format(GS_STATIC_BUCKET_NAME) STATIC_ROOT = "static/" MEDIA_URL = 'https://storage.googleapis.com/{}/'.format(GS_MEDIA_BUCKET_NAME) MEDIA_ROOT = "media/" UPLOAD_ROOT = 'media/uploads/' DOWNLOAD_ROOT = os.path.join(PROJECT_ROOT, "static/media/downloads") DOWNLOAD_URL = STATIC_URL + "media/downloads"` -
I'm using Django ImageField but I can't access the images in my web page
this is models.py from django.db import models # Create your models here. class Products(models.Model): name_product=models.CharField(max_length=100) category_product=models.CharField(max_length=100) price_product=models.CharField(max_length=200) image_product=models.ImageField(default='Image.png',upload_to='web/') description_product=models.CharField(max_length=400) this is views.py from django.shortcuts import render from .models import Products # Create your views here. def asli(request): data=Products.objects.all() return render(request,'home.html',{'data':data}) this is my web page <img src="{{ data.image_product.url }}" alt="Product Image"> I tried this code in the setting.py but still it doesn't show my photos on my web page P.s: The connection has been established correctly MEDIA_URL = "media/" MEDIA_ROOT = BASE_DIR / "media" -
What is wrong with my Django templating, not loading static files?
I am fairly new to Django so would appreciate any help! I have been trying to solve this issue for hours still no hope. I want to use Django template. I have a base.html and a home.html that extends base.html. Base.html is just a layout, with a header and footer. Home.html is just the content I want to display, like a logo. Base.html: {% load static %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="{% static 'restaurant/css/styles.css' %}"> <title>{% block title %}Little Lemon{% endblock %}</title> </head> <body> <div class="navbar"> <a href="/restaurant/"><img src="{% static 'restaurant/images/logo.png' %}" alt="Little Lemon" style="height:40px;"></a> <a href="/restaurant/menu">Menu</a> <a href="/restaurant/about">About</a> <a href="/restaurant/contact">Contact</a> </div> <div class="container"> {% block content %} {% endblock %} </div> <div class="footer"> <p>&copy; 2024 Little Lemon. All rights reserved.</p> </div> </body> </html> Home.html: {% extends 'restaurant/base.html' %} {% block title %}Home{% endblock %} {% block content %} <h1>Welcome to Little Lemon!</h1> <p>Enjoy the best food in town at our cozy restaurant. We offer a wide variety of dishes made from the freshest ingredients.</p> <img src="{% static 'restaurant/images/logo.png' %}" alt="Little Lemon" style="width:100%;max-width:600px;"> <p>Visit us for a dining experience you'll never forget.</p> {% endblock %} I tried simplifying it and β¦ -
In Django, how to upload an epub and display the epub's xhtml contents as a (checkbox) list for further processing of xhtml file content?
High-level overview: I have a Django project, and I'm trying to create an interface to allow users to upload an epub. On form submission, the epub would be processed (unzipped), and its xhtml contents would be display as a list of s on the new page. This new page would also be a form/view. The user could then select the xhtml files they want and submit that form. The selected xhtml files would then have their text extracted and display on the third and final view. View 1: Form to allow users to choose an epub from their computer. View 2: Form that displays XHTML files extracted from the uploaded epub. View 3: Displays text extracted from the selected XHTML files. I have the view to upload the epub, but this is where I get lost. How can I process the epub and pass the files to use in the new view? If there's a different way to process the epubs contents rather than unzipping the file, that would work, too! -
Why is my mysqldump failing? I get [ERROR] unknown variable 'database=dbasename'
When I try a mysqldump, I get [ERROR] unknown variable 'database=dbasename'. I suspect it has to do with this option being in the [client] section of my my.cnf file, but it works just fine for my Django application. If it should be defined elsewhere, to where should it be moved, and will it then mess up my Django app? I tried moving the option to the [mysql] group but it crashed Django instead of fixing the problem. -
How to regroup Django commands in sub directories?
How can I regroup management commands? I tried the following but the 2 commands are not discovered by Django. I also tried with an import in the commands/__init__.py file without success. myapp/ management/ __init__.py commands/ __init__.py user_management/ __init__.py create_user.py delete_user.py -
AttributeError EmailAddressManager object has no attribute is_verified
I get the following error while attempting to a register a user with the help of DRF, dj-rest-auth and django-allauth: AttributeError at /api/v1/dj-rest-auth/registration/ 'EmailAddressManager' object has no attribute 'is_verified' Here is a part of settings.py file: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [BASE_DIR / "templates"], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', "django.template.context_processors.request", ], }, }, ] EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" SITE_ID = 1 and project level urls.py file: urlpatterns = [ path('admin/', admin.site.urls), path('', include('apps.pages.front.urls')), path('api/v1/', include("apps.contacts.api.urls")), path('api-auth/', include("rest_framework.urls")), path("api/v1/dj-rest-auth/", include("dj_rest_auth.urls")), path("api/v1/dj-rest-auth/registration/", include("dj_rest_auth.registration.urls")), ] (i'm keeping my apps in a dedicated apps folder. and have created a custom user model) Leaving the email field empty will successfully register a new user, but it won't work if i add an email. -
How to pass a dictionary through to a template in Django
I am watching a django tutorial (Corey Schafer on how to build a webapp, however I had to use a different method of getting the template to appear. That is all working well. The function he uses has an argument where I don't, that allows the dictionary to appear on the site. Any ideas on how to fix this? (sorry if this is a rookie question, I'm very new) from django.shortcuts import render from django.http import HttpResponse from django.template import loader def home(request): context = { 'news': news } template = loader.get_template('home.html') return HttpResponse(template.render()) I tried to pass it through alongside template.render() and it made all of the raw HTML code come up on screen. -
Django Admin is not Showing
What is the problem below and how to solve it? After runserver I didn't see the admin panel. `Page not found (404) βE:\Masud Ahmad\Pyhood\MyBlogs\blogone\adminβ does not exist Request Method: GET Request URL: http://127.0.0.1:8000/admin Raised by: django.views.static.serve Using the URLconf defined in blogone.urls, Django tried these URL patterns, in this order: admin/ base/ [name='base'] [name='home'] ^(?P.*)$ The current path, admin, matched the last one.` I tried to fix, I checked the code repeatedly, but couldn't point out the problem. -
Django (rest framework) performance of queryset union versus Q versus other ideas
I am creating a search functionality that searches through multiple models that have relations to my main model. Using Django rest framework I then return a paginated result back on every object of my main model that is related to the search query. As the searches are quite "wildcard" like and search in text fields I want to make this as performant (good performance?) as possible. Currently I have implemented it using queryset unions, thinking at least the querysets are lazy loading. When trying to implement it using Q() I had to go through getting the actual foreign key constraints IDs as value_lists and I think that makes for more computation needed? But I don't have a good sense on what is what in terms of performance. To clarify performance: I want low CPU and memory usage on the host itself (these are EC2 instances in AWS) and am slightly less concerned about DB performance (RDS instance in AWS) but it is of course still important. Current code: def get_queryset(self): search_query = self.request.query_params.get('search_query', None) modelA_used = self.request.query_params.get('modelA', 'not_used') modelB_used = self.request.query_params.get('modelB', 'not_used') modelMain_description = self.request.query_params.get('description', 'not_used') modelMain_subject = self.request.query_params.get('modelMain_subject', 'not_used') modelC_used = self.request.query_params.get('modelC', 'not_used') if search_query: queryset = modelMain.objects.none() if β¦ -
django-select2 with crispy form
Currently, i am building a form. There should be two Multiple Select Box (pillbox), but it is not showing up correctly. What could be the error? I have already done all the necessary installation and included it in my path forms.py: class CreateModuleForm(forms.ModelForm): module_lead = forms.ModelChoiceField(queryset=CustomUser.objects.filter(role_fk__name='professor'), label="Module Lead",widget=Select2Widget(attrs={'data-placeholder': 'Select Module Lead', 'class': 'form-control'})) professors = forms.ModelMultipleChoiceField(queryset=CustomUser.objects.filter(role_fk__name='professor'), required=False, widget=Select2MultipleWidget(attrs={'data-placeholder': 'Select Professors', 'class': 'form-control', 'data-maximum-selection-length': 10})) courses = forms.ModelMultipleChoiceField(queryset=Course.objects.all(), required=False, widget=Select2MultipleWidget(attrs={'data-placeholder': 'Select Courses', 'class': 'form-control', 'data-maximum-selection-length': 10})) class Meta: model = Module fields = ['code', 'name', 'credit', 'start_date', 'end_date', 'enrollment_limit', 'description'] widgets = { 'code': forms.TextInput(attrs={'class': 'form-control'}), 'name': forms.TextInput(attrs={'class': 'form-control'}), 'credit': forms.NumberInput(attrs={'class': 'form-control'}), 'start_date': forms.DateInput(format=('%Y-%m-%d'), attrs={'class': 'form-control', 'type': 'date'}), 'end_date': forms.DateInput(format=('%Y-%m-%d'), attrs={'class': 'form-control', 'type': 'date'}), 'enrollment_limit': forms.NumberInput(attrs={'class': 'form-control'}), 'description': forms.Textarea(attrs={'class': 'form-control'}), } def __init__(self, *args, **kwargs): super(CreateModuleForm, self).__init__(*args, **kwargs) self.fields['module_lead'].empty_label = None template.html: {% extends "admin_lms/base.html" %} {% load crispy_forms_tags %} {% load static %} {% block extrahead %} <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet" /> {{ form.media.css }} {% endblock %} {% block content %} <div class="container"> <h2>Create Module</h2> <form method="post"> {% csrf_token %} {{ form|crispy }} <button type="submit" class="btn btn-success">Create</button> <a href="{% url 'index' %}" class="btn btn-secondary">Back</a> </form> </div> {% endblock %} {% block extrajs %} <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script> {{ form.media.js }} β¦ -
Auto reload on adding or updating object in django admin
I want to know if there is a way to auto-reload the Django application when adding or updating an object in the Django admin ? Actually, when I add or update an object, I have to reload my application, and I no longer want this behavior, please -
Django rest framework + React JSX app Google Authentication
I'm creating a web application for my university gymnasium. It requires me to add the functionality to let the university members to register using their university google account and any external users to register using their email. They cannot use google login. I can create the external user registration process, but I don't know how to create the Registration with google account part. I tried several times to do this watching youtube videos and several online articles but, I still don't understand how to do this. https://github.com/TKBK531/gym_application This is my github repository for the project. I'm still relatively new to this area and I would love some advice. Thanks. -
Django + Vuejs | Forbidden (403) CSRF verification failed. Request aborted. | Reason given for failure: CSRF cookie not set
i am currently implementing VueJS in my Django application. During it's early development i had no reason to use any frontend framework due to the original scope of the project. but now after many months it has come to my desk the need for a better frontend solution. i choose VueJS for various reason. i have encoutered this problem while trying to log in: my error While implementing the Login / Registration feature i went with this choices: Firstly this is my settings.py: """ Django settings for project project. Generated by 'django-admin startproject' using Django 3.2.19. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ import os from pathlib import Path from dotenv import load_dotenv import environ # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) env = environ.Env( # Definisci i valori di default per le variabili DEBUG=(bool, False) ) env_file = os.path.join(BASE_DIR, '.env.staging') if os.path.isfile(env_file): environ.Env.read_env(env_file) DOMINIO_INVITO_EMAIL = env('DOMINIO_INVITO_EMAIL', default='localhost:8000') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = ['*'] # CSRF_TRUSTED_ORIGINS = ['https://ea7f-84-221-58-53.ngrok-free.app'] β¦ -
Ajax not giving Json response with django data base create thing
Hey I am learning django. I am trying a basic thing with ajax and django. function RegisterEmail() { $.ajax({ type: "POST", url: "/registerBackend", data: { email: $("#email").val(), csrfmiddlewaretoken: $('[name=csrfmiddlewaretoken]').val(), }, success: function () { alert("Success! Check email to start making your portfolio") }, error: function () { alert('error'); } }); } here is the ajax response code def registerBackend(request): email = request.POST.get("email") print("here") return JsonResponse({"status": "success"}) this is working perfectly fine printing here and also giving success alert. def registerBackend(request): email = request.POST.get("email") Pros.objects.create(email=email) print("here") return JsonResponse({"status": "success"}) while this is perfectly creating pros object in table AND ALSO PRINTING HERE but not showing the success alert. I have zero idea why this is working like this. while this is perfectly creating pros object in table AND ALSO PRINTING HERE but not showing the success alert. I have zero idea why this is working like this. -
Different translations for different sites
I am building a directory engine with Django. It will be used on different domains, such as houses.com and games.com etc. There's a button on the header, which is 'Add Item' which redirects to item creation page. It's wrapped with {% trans %} tag. But I want translation of that button to be "Add your house" on houses.com and "Add Your Game" on games.com. What is best practice for doing that? I was expecting to find a solution for that. -
Dependency Conflicts with drf-haystack==1.8.13 and djangorestframework==3.15.0
I recently upgraded my Django version from 4.0 to 4.2, which necessitated an upgrade of djangorestframework to version 3.15.0 due to compatibility issues (Django REST Framework 3.15.0). However, I'm encountering a dependency conflict with drf-haystack. The latest version of drf-haystack (1.8.13) has a requirement for djangorestframework to be <=3.14. Here is the warning I'm receiving: Warning!!! Possibly conflicting dependencies found: * drf-haystack==1.8.13 - djangorestframework [required: >=3.7,<=3.14, installed: 3.15.0] Is there a way to resolve this dependency conflict without downgrading djangorestframework? Would forking drf-haystack and adjusting its dependencies be a viable solution? I tried downgrading djangorestframework to 3.14 but I am skeptical about its compatibility with Django 4.2 as Django's 4.2 version is not mentioned in the requirements of djangorestframework==3.14 https://github.com/encode/django-rest-framework/tree/3.14.0?tab=readme-ov-file#requirements -
rembg_cars: {"error": "[Errno 2] No such file or directory: 'carros.pth'"}
I am trying to remove BG from car using rembg-cars Python package. But here I am facing a problem. {"error": "[Errno 2] No such file or directory: 'carros.pth'"}.. Most likely here have not given the custom model. How effective (rembg-cars) Python package? output_data = remove(input_data , model_name="carros")