Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django ValueError Datetime-Local Input does not match format '%A'
Getting a value error when trying to parse the day of the week from a datetime-local HTML input. Running python 3.8. Here is my code: Date: <input type="datetime-local" name="date"/><br /><br /> views.py: import datetime ___ def post(self, request): t = ticket(name = request.POST["name"], address = request.POST["address"], region = request.POST["region"], date = request.POST["date"], day = datetime.datetime.strptime(request.POST["date"], "%A")) t.save() models.py: class ticket(models.Model): name = models.CharField(max_length=40) address = models.TextField() region = models.ForeignKey(region, on_delete=models.CASCADE) date = models.DateTimeField() day = models.CharField(max_length=40) Help is appreciated. Thank you. -
How to temporary save database updates before approval from administrator in Django?
My problem is the following: I am developing a collaborative website in Django where every user can make changes in the database. Say I have a model MyModel as follows class MyModel(models.Model): name = models.CharField(max_length = 1000) description = models.TextField() and, I have an HTML form somewhere that displays the two fields and that every user can access to make changes. What I would like to do is that every time a user submits a change for an instance of MyModel, this update is saved somewhere temporary. Then, when the administrator logs in, he/she can see the submitted updates and can approve them or not. I have no ideas how to implement this in Django. If anyone has done that already or have an idea, that would be great :) Thanks ! -
images_data = validated_data.pop('images') KeyError: 'images'
I am tryiI am trying to upload multiple images to the article as ArrayField(ImageField()) is not working on Django right now. Here are my codes: Models.py class Article(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) author = models.ForeignKey(User,on_delete=models.CASCADE,related_name='articles') class ArticleImages(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) image = models.ImageField(upload_to='images',null=True,blank=True,) article = models.ForeignKey(Article, on_delete=models.CASCADE,null=True,blank=True,related_name='images') Serializers.py class ArticleImagesViewSerializer(serializers.ModelSerializer): class Meta: model = ArticleImages fields = ('id','image') def create(self, validated_data): return ArticleImages.objects.create(**validated_data) class ArticleViewSerializer(serializers.ModelSerializer): images = ArticleImagesViewSerializer(required=False,many=True,allow_null=True) class Meta: model = Article fields = ('id','author','images') def create(self, validated_data): images_data = validated_data.pop('images') article = Article.objects.create(**validated_data) for image_data in images_data: ArticleImages.objects.create(article=article, **track_data) return article Views.py class ArticleView(CreateAPIView): queryset = Article.objects.all() serializer_class = ArticleViewSerializer permission_classes = (AllowAny,) def get(self, request, format=None): queryset = Article.objects.all() serializer = ArticleViewSerializer() return Response(serializer.data) def post(self, request, *args, **kwargs): serializer = ArticleViewSerializer(data=request.data) if serializer.is_valid(): article = serializer.save() serializer = ArticleViewSerializer(article,many=True) return Response(serializer.data, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) class ArticleImagesView(CreateAPIView): queryset = ArticleImages.objects.all() serializer_class = ArticleImagesViewSerializer permission_classes = (AllowAny,) def get(self, request, format=None): queryset = ArticleImages.objects.all() serializer = ArticleImagesViewSerializer() return Response(serializer.data) def post(self, request, *args, **kwargs): serializer = ArticleImagesViewSerializer(data=request.data) if serializer.is_valid(): articleimages = serializer.save() serializer = ArticleImagesViewSerializer(articleimages,many=True) return Response(serializer.data, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) Now i am facing with an issue that gives KeyError: images_data = validated_data.pop('images') … -
How to get n last elements from list in Django template
I have an image slider inside my website and I want it to display n (or in my case 3) preview_image of the latest posts. In models.py: preview_image = models.ImageField(default="img/news/default_preview.png", upload_to="img/news") In views.py: def home(request): context = { "posts": list(Post.objects.all()) } return render(request, "news/news_home.html", context) In news_home.html: ... <img src="{{ posts.1.preview_image.url }}" alt=""> ... This works for specific post, but I want to select the latest(last one) in the list, so far I tried: <img src="{{ posts|slice:'-1:'.preview_image.url }}" alt=""> <img src="{{ posts|slice:'-2:-1'.preview_image.url }}" alt=""> <img src="{{ posts|slice:'-3:-2'.preview_image.url }}" alt=""> But I get an error: Exception Value: Could not parse the remainder: '.preview_image.url' from 'posts|slice:'-1:'.preview_image.url' Anyone knows how to solve this? -
How to persist a session in sqlalchemy orm in order to simulate a cache
i'm using automap from sqlalchemy to automatically generates mapped classes and relationships from a database schema. So, in this way, it's not necessary create models. But, there's a problema with this to mapping classes and relationships, it's ver very slow. And, every singlw time i make a request, all the process is loading again. I wann know if there a way to keep the tables saved or persist them, like a cache. so that I don't have to pull them from the database with every request made. This is the original code: metadata = MetaData() metadata.reflect(engine) Base = automap_base(metadata=metadata) Base.prepare() table = getattr(Base.classes, <tablename>) I make a request: tablename = request.data[<tablename>] And, with this function, i take the table and they respective relations, if they exist: from django.conf import settings engine = settings.ENGINE['engine'] session = settings.SESSION['session'] def create_model(request_table): metadata = MetaData() metadata.reflect(engine, only=[request_table]) Base = automap_base(metadata=metadata) Base.prepare() return Base.classes But, like i said, every time a made a request, this function is loading again. I'm new to sqlalchemy orm and really need help. Also, i'm not using flask, i'm using django. -
How to update the User id in a related model's instance in Django
I am intending to populate the model's created by field with the user ID using a base model and to do that, I am updating the field in form valid method like this: form.instance.created_by = self.request.user # "created_by" : Field in the base model However, when I try to do this to update the created by field of the child model using: my_formset.instance.created_by = self.request.user the (created by) field is not updated (remain's blank) in the child model's record. As designed for the application logic, the child instances may be created during the create process as well as (at any point in time) at updates. So if a user different from the one who created the records, updates to add a new line item (child instance), it is intended that the user id should be saved in that particular (child) record (I hope I am able to convey the goal properly here). How should I approach this scenario? -
How to display formset with data generated by view
I can not figure out how to display data grid as a formset. They way my site works- user provides string in search field which later I use to display items that contain this string. The way I used to display it was: {% for item in found_items %} <form method="post" action="."> {% csrf_token %} <tr> <td> {{item.model}} </td> <td> {{item.symbol}} </td> <td> {{item.ean}} </td> <td><div class="form-group"> <input type="text" class="form-control" placeholder=0 name="qty" id="qty"> </div></td> <td> <button type="submit" name="add" class="btn btn-success" value="{{item.pk}}">Add</button> </td> </tr So I displayed a list of forms as a table. It worked very good but I want to change the behaviour by adding "ADD ALL" button (to an order). Basically I want to display all of my "found_items" with "quantity" input box and add all of items with quantity > 0 (user will provide quantity). Iterating through forms is difficult, I would have to send number of found items to template, give every form different name/id, iterate through all of them to check if quantity is > 0 and then add items to my order. I've read about formsets but I can't figure out how to use it in this example. The way it seems to work … -
blank page in pagination Django 3.1
I implemented the Django pagination to slice the results of the search on my site. # views.py def search(request): # Keywords if 'keywords' in request.GET: keywords = request.GET['keywords'] if keywords: title_list_control_valve = queryset_list.filter(title__icontains=keywords).order_by('title') description_list_control_valve = queryset_list.filter(description__icontains=keywords).order_by('description').distinct('description') result_list_control_valves = list(chain(title_list_control_valve, description_list_control_valve)) result_list_control_valves_2 = list(dict.fromkeys(result_list_control_valves)) paginator = Paginator(result_list_control_valves_2, 1) page = request.GET.get('page') paged_queries = paginator.get_page(page) context = { 'queries': paged_queries, } return render(request, 'pages/search.html', context) else: return render(request, 'pages/search.html') else: return render(request, 'pages/search.html') the URL of the site when showing search results is : http://localhost:8000/pages/search/?keywords=something It works perfectly fine on the first page only. From the second page on, it shows an empty page, and the URL of the site changes to: http://localhost:8000/pages/search/?page=2 I link to other pages in the HTML as following: <div class="col-md-12"> {% if queries.has_other_pages %} <ul class="pagination"> {% if queries.has_previous %} <li class="page-item"> <a href="?page={{queries.previous_page_number}} " class="page-link">&laquo;</a> </li> {% else %} <li class="page-item disabled"> <a class="page-link">&laquo;</a> </li> {% endif %} {% for i in queries.paginator.page_range %} {% if queries.number == i %} <li class="page-item active"> <a class="page-link">{{i}}</a> </li> {% else %} <li class="page-item"> <a href="?page={{i}} " class="page-link">{{i}}</a> </li> {% endif %} {% endfor %} {% if queries.has_next %} <li class="page-item"> <a href="?page={{queries.next_page_number}}" class="page-link">&raquo;</a> </li> {% else %} <li … -
Multi-part form in Django
I have this model class VehicleOption(models.Model): vehicle = models.ForeignKey(Vehicle, on_delete=models.CASCADE) option_name = models.CharField(max_length=60) I want to create a form in which I can add 0 or more instance of this model in the DB with a single form but I can't seem to make it work. I tried like this: class ExtraOptionForm(forms.ModelForm): option = forms.CharField(max_length=60) class Meta: model = VehicleOption fields = ('option', ) def vehicle_extra_option(request, vehicle_id): ExtraOptionFormSet = modelformset_factory(VehicleOption, form=ExtraOptionForm, min_num=0, max_num=10, validate_max=True, extra=10) if request.method == 'POST': formset = ExtraOptionFormSet(request.POST, queryset=VehicleOption.objects.none()) if formset.is_valid(): for form in formset.cleaned_data: if form: option = form['option'] option = VehicleOption(vehicle=vehicle_id, option_name=option) option.save() # use django messages framework messages.success(request, "Rregjistrim me sukses!") return HttpResponseRedirect("/") else: messages.error(request, "Error!") else: formset = ExtraOptionFormSet(queryset=VehicleOption.objects.none()) But I can ['ManagementForm data is missing or has been tampered with'] error. Thanks in advance! -
Django on Heroku - missing staticfiles manifest.json file
I am trying to start Django on Heroku. I looked around Stack Overflow, I tried different things, but I cannot figure it out. It looks similar to all the questions related to staticfiles problem on Django, unfortunately I don't know where the problem is. My project runs just fine with DEBUG = True, but when I change it to False, I get following traceback: 2020-11-09T13:13:42.801384+00:00 app[web.1]: Missing staticfiles manifest entry for 'order/css/open-iconic-bootstrap.min.css' It happens on all of my apps that require staticfiles. I tried to find manifest.json, but it does not exist. So I think this is the issue. Here are my relevant settings: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', #more ... ] STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static') ] STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/' STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage' django_heroku.settings(locals()) Thanks for looking into this! -
Send Data to a Django UpdateAPIView through Axios
I am sending Email in the body of an Axios patch request. const userData = await this.$axios.patch(`/user/${id}/update/`, { email: value }) I am sending it to this API View in with Django rest framework class UserAPIView(generics.UpdateAPIView): serializer_class = serializers.UserDetailsSerializer def get_object(self): return User.objects.filter(id='id') I tried running it on Swagger and Postman and it is working good, but in Axios, it throws an error of TypeError: Cannot read property 'email' of undefined Is there any other way of sending it? Thanks! -
Creating a Job using Django to fetch data from API
I am doing a project using Django that will consume an external API. However, in this project I will need to set up the times that django will consume this Third API. So basically, I will need to creat a job to fetch this data. Do you guys have any public github or a manual that I can use as an example? I never did this before and it is so hard to find a tutorial about it or something like that. -
Django model field contain strange attribute _("private")
Currently I have been learning Django & during reading I have come to know below line of text which I am not able to understand properly. private = models.BooleanField( _('private'), default=False, help_text=_('theme is available ONLY for the site.'), ) in above line of code contain _('private') and I am not able to understand what is use of it.I know about using "_" for translation related stuff. Why attribute name not declared for _("private"). I have tried to find online solution but not able to find solution. Thanks. -
Django model field contain strange attribute _("private")
Currently I have been learning Django & during reading I have come to know below line of text which I am not able to understand properly. private = models.BooleanField( _('private'), default=False, help_text=_('theme is available ONLY for the site.'), ) in above line of code contain _('private') and I am not able to understand what is use of it.I know about using "_" for translation related stuff. Why attribute name not declared for _("private"). I have tried to find online solution but not able to find solution. Thanks. -
AttributeError: Got AttributeError when attempting to get a value for field `images` on serializer `ArticleViewSerializer
What i am trying to do is create a serializer to post multiple images for an article as ArrayField(ImageField()) does not work. I have checked if there is any typo or so but it seems like there is no typo.Serializers work fine separately,only i get this problem where i try to combine them. Here are the codes: Here is the serializers.py class ArticleImagesViewSerializer(serializers.ModelSerializer): class Meta: model = ArticleImages fields = ('id','image') def create(self, validated_data): return ArticleImages.objects.create(**validated_data) class ArticleViewSerializer(serializers.ModelSerializer): images = ArticleImagesViewSerializer(many=True) class Meta: model = Article fields = ('id',''images','author') def create(self, validated_data): images_data = validated_data.pop('images') article = Article.objects.create(**validated_data) for image_data in images_data: ArticleImages.objects.create(article=article, **image_data) return article Here is the views.py class ArticleView(CreateAPIView): queryset = Article.objects.all() serializer_class = ArticleViewSerializer permission_classes = (AllowAny,) def get(self, request, format=None): queryset = Article.objects.all() serializer = ArticleViewSerializer() return Response(serializer.data) def post(self, request, *args, **kwargs): serializer = ArticleViewSerializer(data=request.data) if serializer.is_valid(): article = serializer.save() serializer = ArticleViewSerializer(article,many=True) return Response(serializer.data, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) class ArticleImagesView(CreateAPIView): queryset = ArticleImages.objects.all() serializer_class = ArticleImagesViewSerializer permission_classes = (AllowAny,) def get(self, request, format=None): queryset = ArticleImages.objects.all() serializer = ArticleImagesViewSerializer() return Response(serializer.data) def post(self, request, *args, **kwargs): serializer = ArticleImagesViewSerializer(data=request.data) if serializer.is_valid(): articleimages = serializer.save() serializer = ArticleImagesViewSerializer(articleimages,many=True) return Response(serializer.data, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) … -
How can I get custom form field value from within Django Admin's response_change?
I've added a custom functionality to a model by overriding change_form.html. Basically, I'm letting users change the objects of a model if these changes were approaved by the admin. I added two buttons, named accept-suggestion and decline-suggestion and I intend to handle the custom functionality through response_change method: def response_change(self, request, obj): if "decline-suggestion" in request.POST: # do stuff... if "accept-suggestion" in request.POST: # do stuff... Both buttons will send an e-mail to the user saying if the suggestion was declined or approaved. So far so good. The problem is that I want to add the possibility to the admin write a brief justification explaininig why the suggestion was declined. So I changed change_form.html again. <div class="submit-row"> <div class="float-left"> <a class="decline-button-outlined accordion" type="button" href="#">DECLINE SUGGESTION</a> </div> <div class="float-right"> <input class="accept-button" type="submit" name="accept-suggestion" value="ACEITAR SUGESTÃO"> </div> </div> <div class="additional-infos"> <fieldset class="module aligned"> <div class="form-row"> <label for="decline-reasons">Reasons for rejection:</label> <textarea placeholder="If you find necessary, provide information on the reasons that led to the rejection of the suggestion" id="decline-reasons" class="vLargeTextField" rows="5"></textarea> </div> <div class="submit-row"> <div class="float-right"> <input class="decline-button" type="submit" name="decline-suggestion" value="DECLINE"> </div> </div> </fieldset> </div> This is the best approach? If yes, how can I get the value of the <textarea> above from … -
How to solve CSRF "Forbidden Cookie not set" error in Django?
I am using Angular 8 as frontend and Django 1.11.18 as backend. I am running my Angular project on https://127.0.0.1:4200 through command ng server --ssl true and Django API's are deployed on a separate redhat server and can be accessed through https://192.xxx.x.xx:7002/ My Login is a GET Request that returns success response with csrf token in header but cookies are not received on the browser at that time and when I call my POST request this cause "Forbidden" error due to CSRF Token. Middleware in my settings.py is: MIDDLEWARE = [ 'Common.customMiddleware.ProcessRequest', 'django.middleware.security.SecurityMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] I have also added: CSRF_TRUSTED_ORIGINS = ["127.0.0.1","192.xxx.x.xx"] but still cookies are not received on the browser Any kind of help will be appreciated. One thing more I would like to mention is that When I deploy the Angular project on the same server on which Django API's are applied then application works fine. -
Disable lint on single line within django template in vs code
Given this html <div class="img-background" style="background-image: url({% static '/img/information_juniors.jpg' %});"> <div class="content"> <h5>Juniors</h5> <p>{{ page.juniors }}</p> </div> </div> Is it possible to disable linting on the single line containing the django tag in VS Code? It is bringing up these errors ) expected css-rparentexpected semi-colon expected css-semicolonexpected at-rule or selector expected css-ruleorselectorexpected at-rule or selector expected css-ruleorselectorexpected I have this for my args, but I can't find any info on linting and django templates "python.linting.pylintArgs": [ "--load-plugins=pylint_django", "--disable=C0111", // missing docstring ] -
Django __exact queryset filter - case sensitivity not working as expected
I am trying to filter a Django queryset where the case should be sensitive, although I am not getting the results I expect from the "__exact" filter, which I believe to be case-sensitive: https://docs.djangoproject.com/en/3.0/ref/models/querysets/ My code looks like this: lower_case_test = MyObject.objects.filter(name_exact="d") for item in lower_case_test: print("item.name: ", item.name) I have 2 in the "MyObject" model, one with name "d" and one with name "D". The output of the above code is: (u'item: ', u'D') (u'item: ', u'd') Can anyone suggest what might be the issue here? Thanks in advance. -
My Post Request is not giving the response i want for NestedSerializers
I am trying to get multiple images throughout POST request but i am having an issue,here are my codes. Models.py class Article(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) author = models.ForeignKey(User,on_delete=models.CASCADE,related_name='articles') images = models.ManyToManyField('Article',symmetrical=False,through='ArticleImages',related_name='fodssfsdmaers', blank=True,) class ArticleImages(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) image = models.ImageField(upload_to='images',null=True,blank=True) article = models.ForeignKey(Article, on_delete=models.CASCADE,null=True,blank=True) Serializers.py class ArticleImagesViewSerializer(serializers.ModelSerializer): class Meta: model = ArticleImages fields = ('id','image') def create(self, validated_data): return ArticleImages.objects.create(**validated_data) class ArticleViewSerializer(serializers.ModelSerializer): images = ArticleImagesViewSerializer(required=False,many=True,read_only=False) class Meta: model = Article fields = ('id',''images','author') def create(self, validated_data): return Article.objects.create(**validated_data) Here is the issue ,the images are not processed throughout the post request so I cannot see any data related to images. { "id": "74e708b1-d045-45b5-8957-d0ac3df6b6d7", "author": "4e9ae720-e823-4e2f-83b3-144573257d73", } Does anybody know why i am facing this issue? -
Problem in Django after Ajax post request
I want django to render my maps.html.Then I click on the google map,ajax send post request with coordinate data and I render other html file with answer.Answer is result of my function which named Get_Answer.It's located in Data_Analysis module.Get_Answer(lng,lat) takes about 3-4 second to get answer and it gets two parameters.I did ajax post request,I see that django render(maps.html) ,when I click on the map,I see that django understand that it's post request and ajax request ,but django doesn't render other html file (answer.html).I don't know why? But I can print result of my function and I see result in the console.My views.py file How can I force Django execute return render(request,'answer.html','form':Data_Analysis.Get_Answer(lng,lat)) or find other way to do what I want. -
How to query database based on user inputs and show results in another page?
Good day everyone. I am trying to build a form which queries the database based on user data inputs and then returns the results in a new page. but I don't know exactly how to do it and I am getting errors. I've looked for a solution but couldn't find any. Please help me if you know any solutions. Thanks in advance. Here are my codes: forms.py class AttendanceForm(forms.Form): course = forms.CharField(max_length=50) department = forms.CharField(max_length=10) semester = forms.IntegerField() views.py class AttendanceForm(generic.FormView): form_class = CrsAttForm template_name = 'office/crsatt_form.html' success_url = reverse_lazy('office:members_list') class MembersList(generic.ListView): template_name = "office/crs_att.html" context_object_name = 'members' def get_queryset(self): return Members.objects.all() # I know I should use .filter method but how could I set the parameters to data received from the form urls.py url(r'^CourseAttendanceForm/$', views.AttendanceForm.as_view(), name='courseattendance'), url(r'^CourseAttendanceForm/Results/$',views.MembersList.as_view(), name='memebrs_list'), -
Django OAuth Toolkit: Custom user : Error: Request is missing username parameter
I am using a custom django user model i have also specified the AUTH_USER_MODEL in settings.py file. My model doesnot contain any field named 'Username'. still encountering an error : {"error":"invalid_request","error_description":"Request is missing username parameter."} when sending post request to http://127.0.0.1:8000/o/token -
I want to add comment functionality in my blog site and i want to save that comment with article name and the user also with the help of "foreign key"
basically i want a comment box where in database i can check for which article this comment is for and in front end in want a comment in which behind every comment there is a username showing models.py class comments(models.Model): user = models.ForeignKey(MyUser, null=True, on_delete=models.CASCADE) article = models.ForeignKey(article, null=True, on_delete=models.CASCADE) comment = models.TextField(max_length=255) timedate = models.DateTimeField(auto_now_add=True, null=True) def __str__(self): return self.comment form <form action="." method="post"> {% csrf_token %} <div class="form-group" style="margin: 10px;"> <textarea class="form-control" name="comment" id="exampleFormControlTextarea1" rows="3" placeholder="Write your feedback"style="margin-bootom: 10px;"></textarea> <button class="btn btn-info">Comment</button> </div> </form> view.py def readfull(request, slug): fullarticle = article.objects.get(slug= slug) if request.method == 'POST': comment = request.POST.get('comment') if MyUser.is_authenticated: feedback = comments(comment = comment) instance = feedback instance.user = request.user instance.save() print('comment saved') return redirect(request, 'readfull',slug=fullarticle.slug) else: print("none") return render(request, 'full.html', {'fullarticle':fullarticle}) -
How to iterate through self made dictionary and access its attributes in DJANGO templates.?
I am getting a Dictionary from the ajax Base function {'Name': 'Dawn Bread Milky', 'Pricse': 60, 'Barcode': 11111, 'Quantity': 2, 'Total_pricse': 120} I send it to an template using genrate_bill = {"Order_ID":Bill_Genrated.id, 'Khaata':is_Khaata,'CustomerName':is_Khaata.name, 'Bill': Bill_Genrated, 'CartList':cart[0], ## Here is an dict i send 'SubTotal':total_amount, 'Discount':0, 'TotalPricse':total_amount } Problem is that how can I access it KeyVallues Like in Django template {% for item in CartList %} <tr> <td>{{item.Name}}</td> <td class="text-center">Rs.{{item.Pricse}}</td> <td class="text-center">{{item.Quantity}}</td> <td class="text-right">Rs.{{item.Total_pricse}}</td> </tr> {% endfor %} It not showing any result