Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Set Session ID Cookie in Nuxt Auth
I have the following set up in my nuxt.config.js file: auth: { redirect: { login: '/accounts/login', logout: '/', callback: '/accounts/login', home: '/' }, strategies: { local: { endpoints: { login: { url: 'http://localhost:8000/api/login2/', method: 'post' }, user: {url: 'http://localhost:8000/api/user/', method: 'get', propertyName: 'user' }, tokenRequired: false, tokenType: false } } }, localStorage: false, cookie: true }, I am using django sessions for my authentication backend, which means that upon a successful login, i will have received a session-id in my response cookie. When i authenticate with nuxt however, i see the cookie in the response, but the cookie is not saved to be used in further requests. Any idea what else i need to be doing? -
How can i run my python program in DJANGO
I have python script of web scraping that fetch given name song from youtube and give me output as in JSON format. it has many field like url,title,thumnail,duration and artist and all these field are stores in JSON file. SO i want to add that script in Django views.py, So how can i implement this. Here is the picture of output. -
Dropdown menu not dropping
Can anyone please tell me why the reports dropdown menu is not working. The one dropdown for user.username works just fine. Appreciate any help!! {% if user.is_authenticated %} <ul class="navbar-nav ml-auto"> <li class="nav-item"> <a style="color: white;" class="nav-link dropdown-toggle" href="#" id="userMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> {{ user.username }} </a> <div class="dropdown-menu dropdown-menu-right"> <button class="btn dropdown-item" href="{% url 'password_reset' %}">Forgot Password?</button> <div class="dropdown-divider"></div> <div class="btn-group "> <a class="btn dropdown-toggle" href=#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Reports</a> <div class="dropdown-menu dropdown-menu-right"> <button class="dropdown-item" href="{% url 'option2020:export' %}">Template</button> <button class="dropdown-item" href="#">Full Reports</button> </div> </div> <div class="dropdown-divider"></div> <button class="dropdown-item" href="{% url 'logout' %}">Log out</button> </div> </li> </ul> {% else %} -
Django-rq queues don't show up with rqinfo monitoring command
I have 4 queues setup in my django settings.py file called default, low, med, and high. I am envoking the workers for each of the queues using the below command -- python3 manage.py rqworker default low med high However, when I run "rqinfo" to monitor the queues and workers, I can only see the 'default' queue with 0 workers associated to it, even with my application running batch jobs. Wondering if I'm missing something obvious here? My application uses python3.7, django, redis and django-rq. Any comments/help is appreciated. Thanks! -
Refactoring views in Django REST framework
I am very new to Python and Django. I have this app that returns 4 different types of transport routes (In the code I only showed two, cause they basically are the same...). These 4 views use the same class-based views, but only the models' names are different. As they all return the same functionality(get, post, put and delete) I ended up repeating the same code over and over again. Is there any way I can refactor it simpler? Any help is appreciated! Thank you :) views.py ********* tube view *********** class TubeListView(APIView): def get(self, _request, format=None): tubeRoutes = TubeRoute.objects.all() serialized_with_user = NestedTubeRouteSerializer(tubeRoutes, many=True) return Response(serialized_with_user.data) def post(self, request, format=None): request.data['traveler'] = request.user.id serializer = TubeRouteSerializer(data=request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data, status=HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE) class TubeDetailView(APIView): def get(self, _request, pk, format=None): tubeRoute = TubeRoute.objects.get(pk=pk) serialized_with_user = NestedTubeRouteSerializer(tubeRoute) return Response(serialized_with_user.data) def put(self, request, pk, format=None): request.data['traveler'] = request.user.id tubeRoute = self.get_object(pk) if tubeRoute.owner.id != request.user.id: return Response(status=status.HTTP_401_UNAUTHORIZED) updated_serializer = TubeRouteSerializer(tubeRoute) if updated_serializer.is_valid(): updated_serializer.save() return Response(updated_serializer.data, status=status.HTTP_200_OK) return Response(updated_serializer.errors, status=status.HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE) def delete(self, request, pk, format=None): tubeRoute = self.get_object(pk) if tubeRoute.owner.id != request.user.id: return Response(status=status.HTTP_401_UNAUTHORIZED) tubeRoute.delete() return Response(status=status.HTTP_200_OK) ********* bus view *********** class BusListView(APIView): def get(self, _request, format=None): busRoutes = BusRoute.objects.all() serialized_with_user … -
django annotate whether exists or not
I have a query I'm using: people = Person.objects.all().annotate(num_pets=Count('pets')) for p in people: print(p.name, p.num_pets == 0) (Pet is ManyToOne with Person) But i'm actually not interested in the number of pets, but only on whether a person has any pets or not. How can this be done? -
AttributeError 'NoneType' object has no attribute 'description'
I've been banging my head for a week with this error and I cannot find the solution. I inherited a legacy app written in Django. I am familiar with Django but not an expert. This application works well in many different environments, Heroku and some other Linux distributions. We required to install a couple of new instances in Debian GNU/Linux 10. Most of the application works well but we started getting exceptions on some commands. The exception is clear, I get the aforementioned error in the title. One of the classes fails to bind a property that works nearly anywhere. In fact, I wrote a test command that mimics loading most of the objects that fail in the process and I don't see any error. After adding a lot of debug information I could nail it down to a couple of unicode methods: def __unicode__: return u'some text with weird chars ó {0}: {1}'.format(self.printer, self.description if self.description else u'another text with weird chars ó') Because this is not English there are some weird chars and it's required in the way it was created to display on the website. The application immediately works if we replace half of those unicode methods … -
How do you redirect to a specific position on a page in Django?
If I were listing out posts on a page through Django, and say I wanted to give users the option to bookmark a post. I would create a view "bookmark_post", but I would have to redirect them somewhere after the function is completed, right? How would I redirect them to exactly the same place they were on the page before they bookmarked it, so they wouldn't have to always keep scrolling down to find it after bookmarking? I feel like I'm somehow overcomplicating this, or maybe I don't have to create an entirely new view in order to bookmark a post. Do you have any ideas? Thanks again. -
Custom authentication in Django
does anybody know what problem it might be. I'm doing custom authentication in order to use token authentication without passing username but email adres instead, during first login. When I run first makemigrations I constantly get like "No in installed apps". I'm pretty shure I have app of that name in installed app. Tutorial I've mentioned about -
Receiving data on a Django app from RabbitMQ
I'm trying to add some real-time features to my Django applications, for that i'm using RabbitMQ and Celery on my django project, so what i would like to do is this: i have an external Python script which sends data to RabbitMQ > from RabbitMQ it should be retrieved from the Django app. I'm sending some muppet data, like this: connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) channel = connection.channel() channel.queue_declare(queue='Test') channel.basic_publish(exchange='', routing_key='Test', body='Hello world!') print(" [x] Sent 'Hello World!'") connection.close() What i would like to do is: as soon as i send Hello World!, my Django app should receive the string, so that i can perform some operations with it, such as saving it on my database, passing it to an HTML template or simply printing it to my console. My actual problem is that i still have no idea how to do this. I added Celery to my Django project but i don't know how to connect to RabbitMQ and receive the message. Is there some tutorial on this? I found various material about using RabbitMQ and Celery with Django but nothing on this particular matter. -
Django migrations gives django.db.utils.ProgrammingError: conflicting NULL/NOT NULL declarations for column "id" of table "item"
My migration looks like: class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='Item', fields=[ ( 'last_modified', DateTimeField(auto_now=True, null=True), ), ( 'id', AutoField( null=False, primary_key=True, serialize=False, verbose_name='ID', ), ), # more fields When run with ./manage.py migrate this gives me the problem above. Inspecting with ./manage.py sqlmigrate shows CREATE TABLE "item" ("last_modified" timestamp with time zone NULL, "id" serial NULL P RIMARY KEY, ... it would seem that setting NOT NULL on the sql statement and running that would make it work, and indeed it does. My question is this: why does Django's automatically generated migrations have sql code that fails to migrate? Running on Django 2.2 and Postgres 12.2 -
How to prevent going to login page while loggedin in django
As the title explains, although I'm successfully logged in, I can't prevent the application from going back to the login page if I entered the path to the page in URL bar. NOTE:I'm not using the built-in user or authentication classes. Here is the code below: class user_login_view(View): form_class = LoginForm template_name = 'main/login.html' def get(self, request): form = self.form_class(None) return render(request, self.template_name, {'form': form}) def post(self, request): form = self.form_class(request.POST) username = request.POST['username'] password = request.POST['password'] if form.is_valid: try: member = user.objects.filter(username=username).first() except user.DoesNotExist: member = None if member != None and member and member.password == password: request.session['username'] = username return redirect('main:index') else: messages.error(request,'account does not exist') return render(request, self.template_name,{'form': form}) else: messages.error(request, 'account does not exist') return render(request, self.template_name,{'form': form}) def index(request): template_name = 'main/loggedin.html' if request.session.has_key('username'): username = request.session['username'] return render(request, template_name, {"username" : username}) else: return HttpResponseRedirect(reverse('main:login')) def logout(request): try: del request.session['username'] except: pass return HttpResponseRedirect(reverse('main:login')) -
Content Timeline implementation django | Performance and Response time Enhancement
I have a django project, with a PostgreSQL as DB, Nginx and gunicorn as web server, and redis as cache backend. I want to show every user a timeline of the contents he/she followed. e.g. Posts from followed users, pages, and etc. I also want to suggest every user some content based on his/her behavior and previous liked posts. So, I know what to do and how to use querysets to find all the data I have to show to user, My problem is that the process is too darn slow! Using Querysets and computing suggested contents every time that user open a window is a very expensive computation for me. I tried to reduce the load by caching the response, and querysets, and also limit the search to an interval of time (mostly from last login of the user, and cache other contents on client side and re-validate just in case there was a change) My question is what can I do to speed up my response, and what is the right architecture/design for my purpose, I'm currently working on Load Balancing to do some of the read queries on a slave DB to reduce the load on my … -
Variable container name inside html
Hi I am trying to use a for loop to assign a chart to a variable container name...please see below. I have it container0 fixed for now but would like it to evaluate to container0, container1, container2 etc... -
expected string or bytes-like object Django PostgreSQL error
Hi guys i have this error when I'm trying to create or update the user model the error is happening on the profile model I'm using Django 2.1.7 with PostgreSQL Internal Server Error: /accounts/update/ File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\utils\dateparse.py", line 106, in parse_datetime match = datetime_re.match(value) TypeError: expected string or bytes-like object Error Traceback Internal Server Error: /accounts/update/ Traceback (most recent call last): File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response response = self.process_exception_by_middleware(e, request) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\views\generic\base.py", line 68, in view return self.dispatch(request, *args, **kwargs) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\rest_framework\views.py", line 505, in dispatch response = self.handle_exception(exc) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\rest_framework\views.py", line 465, in handle_exception self.raise_uncaught_exception(exc) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\rest_framework\views.py", line 476, in raise_uncaught_exception raise exc File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\rest_framework\views.py", line 502, in dispatch response = handler(request, *args, **kwargs) File "E:\practice my skills\fullStackDjangoAndReact\chatapp\accounts\api.py", line 73, in post user = user_ser.save() File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\rest_framework\serializers.py", line 207, in save self.instance = self.update(self.instance, validated_data) File "E:\practice my skills\fullStackDjangoAndReact\chatapp\accounts\serializers.py", line 67, in update profile.save() File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\db\models\base.py", line 718, in save force_update=force_update, update_fields=update_fields) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\db\models\base.py", line 748, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File "E:\PRACTI~1\FULLST~1\chatapp\env\lib\site-packages\django\db\models\base.py", line 812, … -
pytest states Coverage.py warning: Already imported a file that will be measured
I've managed be able to get pytest running, but i think this may also attribute to other problems i have been having. Initially I was getting this traceback error. Im on a windows laptop, Django 3.0, Anaconda venv, and downloaded the template libray for the code in Django Crash Course: Covers Python 3.8 and Django 3.x - Beta Version btw. INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\_pytest\main.py", line 187, in wrap_session INTERNALERROR> config._do_configure() INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\_pytest\config\__init__.py", line 820, in _do_configure INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\pluggy\hooks.py", line 308, in call_historic INTERNALERROR> res = self._hookexec(self, self.get_hookimpls(), kwargs) INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\pluggy\manager.py", line 93, in _hookexec INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs) INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\pluggy\manager.py", line 84, in <lambda> INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\pluggy\callers.py", line 208, in _multicall INTERNALERROR> return outcome.get_result() INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\pluggy\callers.py", line 80, in get_result INTERNALERROR> raise ex[1].with_traceback(ex[2]) INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\pluggy\callers.py", line 187, in _multicall INTERNALERROR> res = hook_impl.function(*args) INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\pytest_sugar.py", line 176, in pytest_configure INTERNALERROR> sugar_reporter = SugarTerminalReporter(standard_reporter) INTERNALERROR> File "c:\users\antho\anaconda3\envs\everycheese\lib\site-packages\pytest_sugar.py", line 214, in __init__ INTERNALERROR> self.writer = self._tw INTERNALERROR> AttributeError: can't set attribute After doing some digging i came a across a fix. Update to pytest 5.4.01. To which i performed … -
Getting the total of refundable items for each order line
I am trying to get the remaining OrderLines of a specific Order that can still be refunded. So for each OrderLine of an Order, I want to calculate the sum of the number attribute of all existing RefundedLine refering to the Orderline. This sum is then compared to the OrderLine number attribute : if it's equal, the line cannot be refunded anymore, if it's less it can be refunded (sum(RefundedLine number) < OrderLine number). (There can be multiple RefundedLine referencing an OrderLine as an Order can have separate Refund till it's fully refunded). Here are my models: class Order(models.Model): pass class OrderLine(models.Model): order = models.ForeignKey(Order, on_delete=models.CASCADE, related_name="order_lines") number = models.SmallIntegerField(default=1, validators=[MinValueValidator(1)]) class Refund(models.Model): """ Is attached to one order, can concern multiples lines """ order = models.ForeignKey(Order, on_delete=models.PROTECT, editable=False) lines = models.ManyToManyField(OrderLine, through='RefundedLine') class RefundedLine(models.Model): """ Used for m2m """ refund = models.ForeignKey(Refund, on_delete=models.CASCADE) line = models.ForeignKey(OrderLine, on_delete=models.PROTECT) number = models.SmallIntegerField(default=1, validators=[MinValueValidator(1)]) Now my attempts and their errors: Attempt 1 : return OrderLine.objects.filter(order=self.order_id, number__lt=Sum(Subquery( RefundedLine.objects.filter(line=OuterRef('pk')).values('number') ))) ERROR: the column « cart_orderline.id » must appear in GROUP BY clause or must be used in an aggregate function LINE 1: SELECT "cart_orderline"."id", "cart_orderline"."order_id", "... The error message is not exact as it … -
Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/contacts/contact.html
I fails to connect my index.html page with contact.html page it shows this above error when i tried Using the URLconf defined in Website.urls, Django tried these URL patterns, in this order: admin/ [name='home-page'] Contact/ The current path, contacts/contact.html, didn't match any of these. This my contacts.urls.py from django.urls import path from . import views urlpatterns = [ path('Contact', views.contacts, name='contact-us') ] my contacts.views.py from django.shortcuts import render # Create your views here. def contacts(Request): return render(Request, 'contact.html') my website.urls.py from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('',include('Websiteapp.urls')), path('Contact/', include('contacts.urls')) ] -
How to automatically render an htmlpage using urllib form currently working page in Django?
Basically am trying to automatically render an htmlpage using urllib form currently working page . Its has to happen when another function runs,which also render to a page. on one side lets consider first.html page where "form action="myweb/google">" onsubmit i have to go to google same time in second.html page i have to automatically render to google itself when i submit the button in first.html -
Storing large JSON data in Postgres is infeasible, so what are the alternatives?
I have large JSON data, greater than 2kB, in each record of my table and currently, these are being stored in JSONB field. My tech stack is Django and Postgres. I don't perform any updates/modifications on this json data but i do need to read it, frequently and fast. However, due to the JSON data being larger than 2kB, Postgres splits it into chunks and puts it into the TOAST table, and hence the read process has become very slow. So what are the alternatives? Should i use another database like MongoDB to store these large JSON data fields? Note: I don't want to pull the keys out from this JSON and turn them into columns. This data comes from an API. -
django view based template problem with PermissionRequieredMixin
i'm new in Django. I'm trying to "override" a permission_required for inheriting view. Example: class ValetView(PermissionRequieredMixin, View): permission_required = ('lav.add_valets') this works fine. If I go to this view, it's works dependient on /admin setted permissions. But now, I need to separate permission in ADD and EDIT, so I created this view inheriting from base: class ValetsEditView(ValetsView) ValetsView.permission_required = ('lav.edit_valets') When I try to access any of two, it said: permission denied but I allow the user only edit feature, NOT add. How can I grant permission only for edit?? I hope it is understood. Thanks! -
Is there a package/app in django to display, edit, export tables?
I'm working on a small Django app that currently logs customers. I have added 3 customers from the admin panel (still figuring out how to work with forms). I have rendered the HTML table to display the data and it works. I'm now looking to provide the table display more functions like pagination, search, export, etc. Can someone guide me on achieving that? I have explored datatables.net, with very little info on youtube unable to get it working. I have also explored djago-tables2 which is not installing (command throws following error. ERROR: Could not find a version that satisfies the requirement django-tables-2 (from versions: none) ERROR: No matching distribution found for django-tables-2 Help is appreciated. -
I need to display a python array in angular
This is the array [ { "TO":"test@gmail.com", "FROM":"nathanoluwaseyi@gmail.com", "SUBJECT":"subject 1", "NAME":"Oluwaseyi Oluwapelumi", "MESSAGE-DATE":[ [ "Hey eniayomi heeyyy", "2019-12-03 20:49:07" ] ] }, { "TO":"test@gmail.com", "FROM":"pelz@gmail.com", "SUBJECT":"Thanks for contacting R", "NAME":"", "MESSAGE-DATE":[ [ "Thanks for contacting me! Once i check my email, i shall definitely get back.", "2019-08-18 19:48:10" ], [ "will check it.", "2019-08-18 19:48:10" ] ] } ] i need it to display on the angular frontend. this is the mail.component.html file <div class="card-body p-0"> <div class="float-left" style="width: 330px; height: 430px; border-right: 1px solid #dad9d9; overflow-x: hidden; overflow-y: auto;"> <div class="p-2 profile-card" style="width: 315px; height: 100px; border-bottom: 1px solid #dad9d9;" *ngFor="let mail of dataservice.data; let i = index;" (click)="viewMail(mail.MESSAGE_DATE,mail.FROM,mail.NAME,mail.DATE,i)" [ngClass]="{'highlight': selectedIndex === i}"> <div class="row"> <div class="col-md-3 pt-2"> <div class="rounded-circle shadow" style="background-image: url('images/avt.jpg'); background-repeat: round; height: 70px; width: 70px;"> <div style="height: 20px; width: 20px; border: 3px solid white;" class="rounded-circle bg-success"></div> </div> </div> <div class="col-md-7 p-0 pl-3 pt-4" style="line-height: 12px;"> <p style="font-size:18px;"><b>{{mail.FROM}}</b></p> <p style="font-size:13px;">{{mail.NAME }}.</p> </div> <div class="col-md-2 p-0 pt-3" style="line-height:11px;"> <p class="text-secondary" style="font-size:12px;">20m <i class="fa fa-star fa-md" aria-hidden="true"></i></p> </div> </div> </div> this is the data.service.ts file mail_det() { this.message = 'Welcome!'; console.log(this.message); this.staff_email=sessionStorage.getItem('email'); console.log(this.staff_email) this.http.get(this.domain_protocol + this.f_domain_name+'/api/v1.0/get_user_detail/?id='+this.staff_email) .subscribe((res) => { this.data = res console.log(this.data) }) } this is the … -
Django - displaying a clickable map that returns to the server the country
Is it possible to create a map that the user clicks on the map and it sends the the server the name of the country that was clicked ? If you can point me to some resources it would be more than enough. -
I am getting an error 'MultiValueDictKeyError' at /store/AddProduct' . how do I solve it without using request.POST.get()
I am getting an error 'MultiValueDictKeyError' at /store/AddProduct' 'desc' in Django project. I search for the solution on the internet and I end up on request.POST.get() but I want to know why it giving me an error, I tried request.POST['desc'] before and it's work for my user login project. why now it's giving error here is my system info: Django Version: 3.0.4 Python Version: 3.8.2 here is view.py from django.shortcuts import render from .models import Gender, Category, SubCategory, Product, Company db_gender = Gender.objects.all() db_category = Category.objects.all() db_subCategory = SubCategory.objects.all() db_product = Product.objects.all() db_company = Company.objects.all() def add_product(request): if request.method == 'POST' : name = request.POST['name'] descp = request.POST['desc'] price = request.POST['price'] offer_valid = request.POST['offer_valid'] offer_value = request.POST['offer_value'] company = request.POST['company'] quantity = request.POST['quntity'] category = request.POST['category'] sub_category = request.POST['sub_category'] size = request.POST['size'] color = request.POST['color'] return render(request, 'checkout.html', {'db_category': db_category, 'db_subcategory': db_subCategory}) else: return render(request, 'checkout.html', {'db_category': db_category, 'db_subcategory': db_subCategory}) it's not showing error for name = request.POST['name'] & company = request.POST['company'][here is a image]1 but it's showing errror for all fields here is my checkout.html file i downloaded this template file from https://colorlib.com/wp/template/estore/ <section class="checkout_area section_padding"> <div class="container"> <div class="billing_details"> <div class="row"> <div class="col-lg-8"> <h3>Product Details</h3> <form class="row contact_form" …