Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
I want to insert value in text box but as the elements are dynamically created, I'm unable to define the element id in the javascript
I want to populate the text area with some text. I wrote a script which does this on a button click. The bottleneck here is that the elements of the HTML are dynamic and are created as per the user's count working on it. Well, my script works for a static text area. How can i make my script helpful for dynamic text area. function insertText(elemID, text) { var elem = document.getElementById(elemID); elem.innerHTML += text; } </script> <input type="button" name="review_type" value="Postitive" onclick="insertText('txt1', 'Negative - ')"; /> <input type="button" name="review_type" value="Nagative" onclick="insertText('txt1', 'Positive - ')"; /> Thanks! -
saving the form in django
I want to save a simple form in Django2 But when I send the form data it gave me an error: __init__() got an unexpected keyword argument 'name' this is my model class Message(forms.Form): name = forms.CharField(max_length=20, widget=forms.TextInput( attrs={'class': 'form-control', 'placeholder': 'Your Name' })) email = forms.EmailField(widget=forms.TextInput( attrs={'class': 'form-control', 'placeholder': 'Your Email' })) messages = forms.CharField(widget=forms.Textarea( attrs={'rows': '5', 'class': 'form-control', 'placeholder': 'Write your message...' })) this is my view def index(request): if request.method == 'POST': form = Message(request.POST) if form.is_valid(): new_messages = Message(name=request.POST['name'], email=request.POST['email'], messages=request.POST['messages']) new_messages.save() return redirect('index') else: form = Message() I try to change the name to anything you think but it did not work. how can I fix this. -
I got a problem during post request in django
I want to send my data through post request. I used postgres database. I also tried for makemigrations and migrate this model, it also shows the error message. When i tried to submit my form, it shows following error. IntegrityError at /formSubmit null value in column "id" violates not-null constraint DETAIL: Failing row contains (Own, Khar, 3, 23, 2323, 23233, 324, null). Request Method: POST Request URL: http://127.0.0.1:8000/formSubmit Django Version: 2.1.7 Exception Type: IntegrityError Exception Value: null value in column "id" violates not-null constraint DETAIL: Failing row contains (Own, Khar, 3, 23, 2323, 23233, 324, null). Exception Location: D:\coding time\Django+ GeoDjango\Django Enviroment\venv\lib\site-packages\django\db\backends\utils.py in _execute, line 85 Python Executable: D:\coding time\Django+ GeoDjango\Django Enviroment\venv\Scripts\python.exe Python Version: 3.7.2 my models.py file is comes form python manage.py inspectdb command. I managed the database in postgres. models.py file is here: class Form(models.Model): name = models.CharField(max_length=30, blank=True, null=True) email = models.CharField(max_length=29, blank=True, null=True) password = models.CharField(max_length=30, blank=True, null=True) class Meta: db_table = 'form' class Ownership(models.Model): house_no = models.IntegerField(blank=True, null=True) ward_no = models.IntegerField(blank=True, null=True) tole = models.CharField(max_length=100, blank=True, null=True) house_owner = models.CharField(max_length=100, blank=True, null=True) gender = models.CharField(max_length=100, blank=True, null=True) religion = models.CharField(max_length=100, blank=True, null=True) language = models.CharField(max_length=100, blank=True, null=True) class Meta: db_table = 'ownership' class Residence(models.Model): ownership_type … -
If I remove migrations files, will there be a problem?
I'm a new in web developing .im in middle of project and my project for now have several DB model .i want put migrations files into .gitignore, if i remove all existance migration files from host server and then after any pull from git in host i using python manage.py makemigration any problem will be occure(i using git for transfer code from local to host)?is need to change anything in local too?(maybe need remove migration in local too) the reason i want do this is : every time i want pull code to host i have a problem with migrations file and after python manage.py migrate telling me x migration need to y migration file that isn't here or something like this message.sorry if my question is unclear . -
Django multi mandate
Ich have following Problem in django: in Login Page i have 3 fields Mandate,Username and Password. When User Login then Django Show in a global Database which local Database is linked to this Mandate and Route all querys from this User to this linked Database. Example: User A Login Witz Mandate AB. Now Django make a query in global Database and Tage linked local Database has the Name "1". Now i wants that all querys from the Views automatical mapped to the Database "1". Another User Login with Mandate BC. In global Database is Mandate linked with Database "2". All querys from These User is mapped then to Database "2" How can i so that? Regards -
How to perform particular operation by button click
I want to perform more than 2 operation in single HTML page by button click. In menu bar have 5 options. i.e when i click Home it perform some operation and when i click profile it perform particular operation. I write separate functions for each operation. How to do multiple functions operations for single page. views.py def home(request): return render(request, 'index.html', {}) def profile(request): if request.method == 'POST': form = ProfileForm(request.POST) if form.is_valid(): first_name = request.session['username'] print(first_name) test = Profile.objects.filter(first_name=first_name).values() for i in test: dict1 = i return render(request, 'index.html', {'first_name': first_name, 'last_name': dict1['last_name'], 'phone_number': dict1['phone_number'], 'email': dict1['email'], 'address': dict1['address'], 'image': dict1['image']}) else: form = ProfileForm() return render(request, 'profile.html', {'form': form}) def friends(request): friends_obj = Friends.objects.all() return render(request, 'index.html', {'friends_obj': friends_obj}) urls.py urlpatterns = [ path('home/', views.home, name="home"), path('profile/', views.profile, name="profile"), path('friends/', views.friends, name="friends"), ] menu bar look like this -
What is the correct way of saving 200 objects in the database using django-rest-framework?
I have a problem to solve this next week in an project. I have a model with 3 fields, 2 of them are foreign key to other models and the other field is a simple string field. In the front-end I'm going to present to the user only a checkbox and a observation field, a string field that can be blank or null. There will be a list of checkbox, around 200. Each one will be a object in the database. I don't want to make a post request for each one of them, would make the user experience really bad, 200 fields are already really bad, but necessary in this case. So I would like suggestions, code example about the best approach to accomplish this. Here is the model. class Person(models.Model): observation = models.TextField(blank=True, null=True) country = models.ForeignKey(Country, on_delete=models.PROTECT) user = models.ForeignKey(User, on_delete=models.PROTECT) I have a serializer and a ModelViewSet working for it with single request, a POST request of 1 object is working. class PersonSet(viewsets.ModelViewSet): queryset = Person.objects.all() serializer_class = PersonSerializer I would like the front-end to send to the back-end a big list/array/object, not sure, and the back-end get this whole data in a single POST request … -
400(Bad request) status code when making request with axios in reactjs
It's working when making a request with postman for when trying to with axios in reactjs its showing 400 status code I have already tried - adding removing headers - adding boundary:--foo handleSubmit(event) { let data = new FormData(); data.append("username", this.state.username) data.append("password", this.state.password) data.append("confirm_password", this.state.confirm_password) data.append("email", this.state.email) event.preventDefault(); axios({ method: 'post', url: 'http://localhost:8000/api/account/register/', data: data, headers:{ "Content-Type":"application/x-www-form-urlencoded; boundary:XXboundaryXX" } }) .then((response) => { console.log('bitchhh'); }) .catch((response) => { //handle error console.log(response); }); } []3 -
How do I read the traceback log to locate the cause of "Object of type bytes is not JSON serializable" problem?
Environment: Request Method: GET Request URL: http://127.0.0.1:8000/search/results?q=tea Django Version: 2.1.7 Python Version: 3.7.3 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'django.contrib.flatpages', 'django.contrib.sitemaps', 'django.contrib.redirects', 'FI', 'AR', 'SM', 'BK', 'TAX', 'STK', 'PR', 'jy_utils', 'caching', 'clear_cache', 'stats', 'billing', 'search', 'checkout', 'accounts', 'tags'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'] Traceback: File "D:\Programs\Python\Python37\lib\site-packages\django\core\handlers\exception.py" in inner 34. response = get_response(request) File "D:\Programs\Python\Python37\lib\site-packages\django\utils\deprecation.py" in call 93. response = self.process_response(request, response) File "D:\Programs\Python\Python37\lib\site-packages\django\contrib\sessions\middleware.py" in process_response 58. request.session.save() File "D:\Programs\Python\Python37\lib\site-packages\django\contrib\sessions\backends\db.py" in save 83. obj = self.create_model_instance(data) File "D:\Programs\Python\Python37\lib\site-packages\django\contrib\sessions\backends\db.py" in create_model_instance 70. session_data=self.encode(data), File "D:\Programs\Python\Python37\lib\site-packages\django\contrib\sessions\backends\base.py" in encode 96. serialized = self.serializer().dumps(session_dict) File "D:\Programs\Python\Python37\lib\site-packages\django\core\signing.py" in dumps 87. return json.dumps(obj, separators=(',', ':')).encode('latin-1') File "D:\Programs\Python\Python37\lib\json__init__.py" in dumps 238. **kw).encode(obj) File "D:\Programs\Python\Python37\lib\json\encoder.py" in encode 199. chunks = self.iterencode(o, _one_shot=True) File "D:\Programs\Python\Python37\lib\json\encoder.py" in iterencode 257. return _iterencode(o, 0) File "D:\Programs\Python\Python37\lib\json\encoder.py" in default 179. raise TypeError(f'Object of type {o.class.name} ' Exception Type: TypeError at /search/results Exception Value: Object of type bytes is not JSON serializable -
How to reset a Many-To-Many-Field in Django?
Lets say I have the following models: class Foo(models.Model): ... class Bar(models.Model): foos = models.ManyToManyField(Foo, blank=True) Now, lets say I have a Bar object, like so: bar = Bar.objects.get(pk=1) Lets also say that bar.foos.all() returns a list of Foo objects. How can I set bar.foos to an empty list? That is, remove all the references. -
Django REST framework - ModelViewSet: "this field is required" when POST, field is FK
This is my current code Models: class Author(models.Model): a_author= models.CharField( primary_key=True, unique=True, db_column='author_id') a_name = models.CharField(db_column='author_name') class Book(models.Model): b_book = models.CharField( primary_key=True, unique=True, db_column='book_id') b_name = models.CharField(db_column='book_name') b_author = models.ForeignKey( Author, on_delete=models.CASCADE, db_column='book_author_name') Serializers class AuthorSerializer(serializers.ModelSerializer): author = serializers.CharField(source='a_author') name = serializers.CharField(source='a_name') class Meta: fields = ('author', 'name') class BookSerializer(serializers.ModelSerializer): book = serializers.CharField(source='b_book') name = serializers.CharField(source='b_name') author = serializers.CharField(source='b_author') class Meta: fields = ('book', 'name', 'author') def create(self, validated_data): author_id = validated_data.pop('author') author = models.Author.objects.filter(a_author=author_id).first() validated_data['b_author'] = author return models.Book.objects.create(**validated_data) Views class BookViewSet(viewsets.ModelViewSet): serializer_class = BookSerializer def get_queryset(self): queryset = models.Book.objects author = self.kwargs.get('author') queryset = queryset.filter(b_author=author) return queryset Url urlpatterns = [ path('library/<str:author_id>/', BookViewSet.as_view({'get': 'list', 'post':'create'})) ] Currently if I post to /library/123abc/ with params: { 'name': 'test', 'author': '123abc' }, it will work - a Book record with name=test, author=123abc will be created. But now I want to take author out of the params (since url already has athor id so I don't want to duplicate it again in params) and send just {'name': 'test'}, it will return 400 error with message {'author': 'this field is required'}. I have tried author = serializers.CharField(source='b_author', required=False) but it didn't work. Is there anyway to get around this? I wonder if … -
How to include HTML file uploaded by user - Django
I'm including ads in my project's html files i was using GIF files Upload it in the admin and use it like: {{ ad.image.url }} but then the client wanted the ad to be HTML file (with js, CSS files) i thought of: Upload a zip file containing all files and extract it to media directory but don't know the best way to achieve this upload each file individually and link it to the ad ID but the problem is what if there were directories not just files? and the main problem is how to inject/include the HTML file content to my HTML page? Please share your ideas -
static files do not show on a live django site served via nginx
I was following a digitalocean tutorial to build a site on a server with django, gunicorn & nginx. The site is live, but the static files don't show. I concluded that the problem must be either from django or nginx (since any static files' configuration is related to either of them here are the codes from: I trued modifying django & nginx configuration since they the source as it seems. 1) the static location definition in the django settings.py file myproject/myproject/settings.py STATIC_URL = '/static/', STATIC_ROOT = "/dir1/dir2/dir3/django_project/static" 2)the nginx configure file at /etc/nginx/nginx.conf http { server { listen 800 default_server; server_name mysite.com; return 444; location /static/ { alias /dir1/dir2/dir3/django_project/; } } 3) the default file in /etc/nginx/sites-availables : server { listen 80; server_name mysite.com; location = /favicon.ico { access_log off; log_not_found off; } location /static/ { root /dir1/dir2/dir3/django_project/; } location / { include proxy_params; proxy_pass http://unix:/run/gunicorn.sock; } } I expect the static files to show up -
Django Circular import on server side
My Django App on local machine is working perfectly . when i deployed the project using git to the server , its giving me this error : The included URLconf 'ApiTest.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import. When i removed importing router the error has been gone so The problem is importing router in urls: from . import router from django.contrib import admin from django.urls import path, include from django.conf.urls import url urlpatterns = [ path('admin/', admin.site.urls), url('api/',include(router.router.urls), name="router"), ] router File : from rest_framework.routers import SimpleRouter from user.Api import viewset router = SimpleRouter() router.register('user_api', viewset.UserViewSet, base_name='user_api') -
How to send mails with office365 and Django?
I have one problem sending mails from office 365(Godaddy) with django send_mail in ubuntu 16.04 DigitalOcean. This is my actual configuration: EMAIL_HOST = 'smtp.office365.com' EMAIL_HOST_USER = "myuser" EMAIL_HOST_PASSWORD = 'mypassword' EMAIL_USE_TLS = True EMAIL_PORT = 587 Sending mail: context = {} subject = 'Verificación de registro con 1 clic' txt_ = get_template("registration/emails/verify.txt").render(context) from_email = settings.DEFAULT_FROM_EMAIL recipient_list = [somemail@somemail.com] html_ = get_template("registration/emails/verify.html").render(context) sent_mail = send_mail( subject, txt_, from_email, recipient_list, html_message=html_, fail_silently=False, ) This is the error raised: raise SMTPSenderRefused(code, resp, from_addr) smtplib.SMTPSenderRefused: (530, b'5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM []', '=?utf-8?q?myuser?= <myemail@myemail.com>') -
How can I combine these two views into one?
I am using Django and have a profile.html that I am attempting to have forms appear at the top of and below that, a list of the posts (paginated) that specific user has made. Is there anyway to combine all the functionality of the def profile (including @login_required) view with the class UserPostListView(ListView) into a single view? How would this be constructed? #1st View @login_required def get_queryset(self): if request.method == 'POST': #pass instance of user that expects to alter u_form = UserUpdateForm(request.POST, instance=request.user) p_form = ProfileUpdateForm(request.POST, request.FILES, instance=request.user.profile) if u_form.is_valid() and p_form.is_valid(): u_form.save() p_form.save() messages.success(request, f'Your account has been updated!') return redirect('profile') else: u_form = UserUpdateForm(instance=request.user) p_form = ProfileUpdateForm(instance=request.user.profile) user = get_object_or_404(User, username=self.kwargs.get('username')) context = { 'u_form': u_form, 'p_form': p_form, 'posts': Post.objects.filter(author=user).order_by('-date_posted') } return render(request, 'users/profile.html', context) #2nd View class UserPostListView(ListView): model = Post template_name = 'forum/profilte.html' context_object_name = 'posts' paginate_by = 5 def get_queryset(self): user = get_object_or_404(User, username=self.kwargs.get('username')) return Post.objects.filter(author=user).order_by('-date_posted') As a side, this is the profile.html I am currently trying to implement: {% extends "forum/base.html" %} {% load crispy_forms_tags %} {% block content %} <div class="content-section"> <div class="media"> <img class="rounded-circle account-img" src="{{ user.profile.image.url }}"> <div class="media-body"> <h2 class="account-heading">{{ user.username }}</h2> <p class="text-secondary">{{ user.email }}</p> </div> </div> <form method="POST" … -
Gunicorn timeout during file download
I'm using nginx as reverse-proxy to be able to access my Django API and also serve static files. My Django API is using gunicorn. I have an endpoint allowing a user to download a csv file. I followed the instructions here, Streaming large CSV files: https://docs.djangoproject.com/en/2.2/howto/outputting-csv/ Here is the nginx configuration: upstream docker-api { server api; } server { listen 443 ssl; server_name xxxx.com; ssl_certificate /path/to/fullchain.pem; ssl_certificate_key /path/to//privkey.pem; include /path/to/options-ssl-nginx.conf; ssl_dhparam /path/to/ssl-dhparams.pem; location /static { autoindex on; alias /static/; } location /uploads { autoindex on; alias /uploads/; } location / { proxy_pass http://docker-api; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Forwarded-Proto $scheme; } } This is the command I use to launch my gunicorn server: gunicorn my_api.wsgi -b 0.0.0.0:80 --enable-stdio-inheritance -w 2 -t 180 -k gevent And when I try to download the file, Gunicorn always timeout my request after 3 minutes. -
Regroup Queryset by ManyToManyField
I'm working with django and I have to recover the records of a model called Restaurante, this has attributes such as Name, Address, Phone, City, etc. and also, it has a food_type attribute that is a ManyToManyFiel, with my model called FoodType, because in a restaurant you can serve many types of food (such as Mexican, Italian, vegan, etc.) and a type of food, it can be offered in many restaurants and I want to recover all the restaurants in X city and group them by types of food, in the following way: Vegan Food The compostera Natural foods GreenRestaurant Resto Bar Italian Food Resto Bar Piere Pizzas The compostera Mexican food Jalisquitos Maya Tacos GreenRestaurant I tried to do it with the tag {% regroup%}, but it shows me the expected output, I attach the code of the models: class FoodType(models.Model): name = models.CharField( max_length = 150, blank = False, null = False, help_text = 'Enter the name of the type of food', verbose_name = 'Name' ) description = models.CharField ( max_length = 250, blank = False, null = False, help_text = 'Enter a brief description of this type of food', verbose_name = 'Description' ) class Restaurant(models.Model): name = … -
How to replace all foreign keys in django model with all the data in the referenced row?
How do I get Django to return all the rows in my database Client while replacing each competitor's id with their respective rows. class Client(models.Model): my_id = models.CharField(max_length=500, unique=True) name = models.CharField(max_length=500) last_update = models.DateField(null=True, blank=True) competitor_1 = models.ForeignKey( "self", related_name="competitor_1a", on_delete=models.CASCADE, to_field="my_id", null=True, blank=True, ) competitor_2 = models.ForeignKey( "self", related_name="competitor_2a", on_delete=models.CASCADE, to_field="my_id", null=True, blank=True, ) competitor_3 = models.ForeignKey( "self", related_name="competitor_3a", on_delete=models.CASCADE, to_field="my_id", null=True, blank=True, ) def __str__(self): return self.name -
How can I access through model's fields with ManyToManyField in Django
I have Store model with connecting each other for similar stores. As you see the code snippet, I'm tyring to access score field in Similarity which is being used as through model for the ManyToManyField in Store model. How can I directly access the score field from Store object? tester.py store = Store.objects.get(id=1) print(store) # Store object print(store.similar_stores.all()[0]) # Store object print(store.similar_stores.all()[0].similarity.score) # throw the below error AttributeError: 'Store' object has no attribute 'similarity' models.py class Store(TimeStampedModel): ... similar_stores = models.ManyToManyField( 'self', through='Similarity', symmetrical=False, related_name='similar_store_of_store') class Similarity(TimeStampedModel): similar_target = models.ForeignKey(Store, related_name='similar_target', on_delete=models.CASCADE) similar_store = models.ForeignKey(Store, related_name='similar_store', on_delete=models.CASCADE) score = models.FloatField(default=0.0) -
When I make an ajax delete request with a checkbox An error occurs in the view function
When I make an ajax delete request with a checkbox An error occurs in the view function. I do not know why. Thank you if you let me know. error : Traceback (most recent call last): File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\django_inflearn2\todo\views.py", line 23, in todo_delete_ajax todo_ids = request.POST['todo_arr'] File "C:\django_inflearn2\venv\lib\site-packages\django\utils\datastructures.py", line 80, in __getitem__ raise MultiValueDictKeyError(key) django.utils.datastructures.MultiValueDictKeyError: 'todo_arr' code is below jquery,ajax $('#todo_delete_button').click(function(e){ e.preventDefault(); // todo_check var todo_arr = []; alert("삭제 버튼 ") // Get checked checkboxes $('.td_check').each(function() { if (jQuery(this).is(":checked")) { var id = this.id; todo_arr.push(id); } }); alert('todo_arr : '+ todo_arr) $.ajax({ type: "POST", url: 'todo_delete_ajax/', data: { todo_arr:todo_arr, csrfmiddlewaretoken: '{{ csrf_token }}' }, success: function(result) { alert('todo_delete_ajax is success '); } }); }) url path('status/',views.todo_status_list, name ="todo_status_list"), view def todo_delete_ajax(request): # print("request " , request ) todo_ids = request.POST['todo_arr'] print("todo_ids : ", todo_ids) return redirect('/todo/') Thank you for your help. Thank you if you can tell me how to fix it. Is the argument value set incorrectly? Is the view function wrong? -
Django doesn't seem to work with some python flags
When running starting a Django server with python manage.py runserver, I want it to catch if there is a BytesWarning in my code. Specifying the -b or -bb flag usually does it in python, eg. python -bb somefile.py. If there is code such as 'b'==b'b' or str(b'b'), a BytesWarning will be given, and the flag makes the interpreter treat it like an error. However in Django, running python -bb manage.py runserver will not cause the BytesWarnings to be caught as an exception in any file except the settings file. For example, I put 'b'==b'b' in a view, and it doesn't bring up a BytesWarning. It doesn't seem to be any configuration settings for the project that are causing this, as I tried this out in the simple app that we make in the Django tutorial at https://docs.djangoproject.com/en/2.2/intro/tutorial01/, and it still doesn't work. I'm current using Django 2.1.7, though I did try it in 1.11.20 with no luck. What could be the problem here? -
tried to connect a ModelForm
i am reciving a "value error" because of "ModelForm has no model class specified." i tried to check the : models.py forms.py and views.py but all looks pretty good for me views.py : class CreatePostView(LoginRequiredMixin,CreateView): login_url='/login/' redirect_field_name='Myblog/post_detail.html' form_class = PostForm model = Post models.py: class Post(models.Model): author = models.ForeignKey('auth.User',on_delete=models.CASCADE) title = models.CharField(max_length=200) text = models.TextField() created_date = models.DateTimeField(default=timezone.now) published_date = models.DateTimeField(blank=True,null=True) forms.py: class PostForm(ModelForm): class meta: model = Post fields = ('author','title','text') from app.urls.py url(r'^post/new/$',views.CreatePostView.as_view(),name='post_new'), -
How can i edit django-crispy form?
Ciao, in the forms.py----> fields = "__all__". In one of these fields, I'd like insert a button to add a new instance of that field. To do this, I have to write all form fields and so delete fields = '__all__'? Or can I customize only one? thanksToAll -
How to do ajax-search in Django-2.2?
I'm trying to do ajax-search in my django project. But i did not find any clear tutorial or documentation for ajax-search. Already i have tried some code but it did not work. (I'm using Python-3.7 and Django-2.2) https://pypi.org/project/django-ajax-search/ i have followed this