Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
how to post foreign key with name of user other than id in django rest framework
hello everything is working fine, but if i want to post any dat in rest framework i need to pass the id of user , which is impractical how can i make it to accept the name of the user and post the the request, find my code below serializers.py class Authserializers(serializers.ModelSerializer): class Meta: model = Unique fields = '__all__' views.py @api_view(['POST']) def auth_post_data(request): serializer = Authserializers(data=request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data) when i type the name of the user as string it does not accept the input, plz help me in this situation -
How can i get checkbutton input in template? django
I try to get this checkbox from bd but i dont know why always is checked. I want to get if is on on bd checked on template but if is not on not checked how can i do? thanks. <input type="checkbox" name="retirar_tr" value="off" {% if request.GET.retirar_tr is on %}checked {% endif %} disabled/> Retirar<br> <input type="checkbox" name="colocar_tr" {% if request.GET.colocar_tr is on %}checked {% endif %} disabled/> Colocar img bd fields -
Error when opening a table through the admin panel of a Django site
Into the Django project imported a SQLite database containing records. When opening tables containing fields with the Date type through the admin panel, an error occurs (see below); when opening other tables of this database, no errors occur. ERROR return datetime.date(*map(int, val.split(b"-"))) ValueError: invalid literal for int() with base 10: b'19 00:00:00' models.py file class Contract(models.Model): registry_number = models.TextField(primary_key=True, blank=True, null=False) link_to_contract = models.TextField(blank=True, null=True) date_conclusion_of_a_contract = models.DateField(blank=True, null=True) class Meta: managed = True db_table = 'Contract' -
how to update each div element with Ajax function using Jquary
I am new to J query and I have an Ajax function to update the select options. The Ajax is working fine on my first Div. But when I clone the div and run the Ajax call it again update the first Div element only not the element of cloned one. I new to closet... etc. Please help me so when I call the Ajax it will update the cloned div(current div) element. this is my ajax function: function acct_dbox() { {#var that = $(this)#} $.ajax( { type: "GET", url: "/waccounts/getaccounts", dataType: "json", data: { {#'acctlevel': $(this).val(),#} 'csrfmiddlewaretoken': '{{csrf_token}}' }, success: function (data) { $.each(data, function(index, item) { if (item.length > 0){ console.log('test', item[0].AcctCode); console.log('test', item[0].AcctName); {#$("#id_accountcode option").remove();#} $.each(item, function(index1, item1) { console.log(item1.id); console.log(item1.AcctCode); console.log(item1.AcctName); $("#id_accountcode").append($('<option/>',{ {#$("#id_accountcode").append($('<option/>', {#} value: item1.AcctCode, text: item1.AcctName })); }) $( document ).ready(function() { acct_dbox(); var original_external_int_div = document.getElementById('account_list'); //Div to Clone var clone = original_external_int_div.cloneNode(true); // "deep" clone original_external_int_div.parentNode.append(clone); acct_dbox(); # (it is updating the first div again - not cloned one) }); -
Ajax, refresh table rows on new additions
I'm working on a Django project that runs a background task every time a form is submitted. It takes roughly 2sec to complete each task, when completed, the results are saved, ajax is supposed to perform page refresh but not the whole page, and what I have so far is: $.ajax({ success: function(){ setInterval('location.reload()', 10000); } }) It works as intended, but it's wrong. I have rather limited experience with js. However, I'd like to refresh only the newly added row(s) in the table. I came across jquery .load() but I've been staring for a while now, please any help? -
Can you suggest good alternative of vemio for uploading videos in my python django project
For my python django project i tried vimeo for video uploading, but it doesn't work properly, when i try to upload it shows server time out error every time, I tried multiple way to handle the error but can't,for that any one can suggest good alternative of vimeio, or any other solutions -
Django Session Variables Don't Work In Stripe Webhook?
I am trying to use data saved in django session variables to run a function once the webhook has confirmed that 'checkout.session.completed' but I always get a key error. I am 100% sure the keys exist in the session variables. Here is my webhook: @csrf_exempt def stripe_webhook(request): # You can find your endpoint's secret in your webhook settings endpoint_secret = 'secret' payload = request.body sig_header = request.META['HTTP_STRIPE_SIGNATURE'] event = None try: event = stripe.Webhook.construct_event( payload, sig_header, endpoint_secret ) except ValueError as e: # Invalid payload return HttpResponse(status=400) except stripe.error.SignatureVerificationError as e: # Invalid signature return HttpResponse(status=400) # Handle the checkout.session.completed event if event['type'] == 'checkout.session.completed': session = event['data']['object'] fulfull_order(session) return HttpResponse(status=200) Here is my fulfill order function: def fulfull_order(session): generator = PlanMaker(goal=request.session['goal'], gender=request.session['gender']) /// send email code. This line generator = PlanMaker(goal=request.session['goal'], gender=request.session['gender']) Always gives a key error on request.session['goal'] The key definitely exists, it just seems it is inaccessible from the webhook view. How to solve? -
How to map graphene.InputObjectType fields to kwargs?
Let's say we have InputObjectType: class OfficeInput(graphene.InputObjectType): orderNumber = graphene.Int(required=True) name = graphene.String() streetAddress = graphene.String() postalCode = graphene.String() city = graphene.String() And python class which take similar arguments, in this case we have mongoengine EmbeddedDocument: class Office(EmbeddedDocument): orderNumber = fields.IntField(required=True) name = fields.StringField(default="", required=True) streetAddress = fields.StringField(default="", required=True) postalCode = fields.StringField(default="", required=True) city = fields.StringField(default="", required=True) I would want to create Office instance by assigning OfficeInput fields to Office constructor, i.e. map OfficeInput fields to dict and pass them to constructor using python **kwargs -
Django admin, relationships [closed]
I want to get related positions after choosing random Department element. enter image description here -
How can I get a value from other model, based in other value from that same other model?
How can I get the proper "sumvalue" in the example? (which I only know how to represent in SQL): class Addition(models.Model): location = models.ForeignKey(Place, ...) a = models.DecimalField(...) b = models.DecimalField(...) @property def c(self): return self.a + self.b class Result(models.Model): place = models.ForeignKey(Place, ...) # I only know how to represent in SQL sumvalue = SELECT c FROM Addition WHERE location = place -
how to use paypal instead of razorpay - django
how to use paypal instead of razorpay in this code .. my code https://gofile.io/d/wV8btv I want to use paypal and save the rest of the codes -
How to make query to postgresql database from Django
This is my request for postgresql: SELECT date, COUNT(*) FROM main_like GROUP BY date; How can i do this request from Django? -
How to use django-colorfield in a forms.py file in django?
I'm trying to use Django-colorfield to create a drop-down from which a color can be selected. However, the priority section in the output just says <colorfield.fields.ColorField>.I tried this answer but it didn't work. Output, Code: #models.py from django.db import models from colorfield.fields import ColorField class Todo(models.Model): text = models.CharField(max_length=40) complete = models.BooleanField(default=False) COLOR_CHOICES = [ ("#8b0000", "red"), ("#ffff00", "yellow"), ("#006400","green") ] priority = ColorField(choices=COLOR_CHOICES) def __str__(self): return self.text #forms.py from django import forms from colorfield.fields import ColorField from .models import Todo class TodoForm(forms.Form): text = forms.CharField(max_length=40, widget=forms.TextInput( attrs={'class' : 'form-control', 'placeholder' : 'Enter todo here', 'aria-label' : 'Todo', 'aria-describedby' : 'add-btn'})) COLOR_CHOICES = [ ("#8b0000", "red"), ("#ffff00", "yellow"), ("#006400","green") ] priority = ColorField(choices=COLOR_CHOICES) -
Blog: How can I make a blog where I can load what ever JS/CSS file I want and format it to what ever layout I want?
So I want to create a unique type blog using Django but I am confused in how I would go about making it. I want to be able to load any library I want but also make the blog entries have unique layout and have different CSS files for each one if overridden from the default. I want to be able to show off my skills from D3.js to Greensocks, ML models I have trained to different things like data structures, algorithms and libraries/technolgies, I really want to peakcock my range of skills I have collected over the past 20 years but Django seems to be a one style fits solution when it comes to blog entries. I want to include many skills in a blog but how to do it has me confused. So far I have done a few tutorials where I have made a basic blog and the voting tutorial aswell as watched some tutorials on YouTube but I'm stuck on how I would create a page that has custom styling and scripts. I have though about making it so I past a whole bunch of HTML into a textfield which does work but looks absolutly terrible … -
Add a CheckConstraint for a related object field in Django models
I've two Django models: class A(models.Model): is_pure = models.BooleanField() class B(models.Model): a = models.ForeignKey(A, on_delete=models.CASCADE) class Meta: constraints = [ models.CheckConstraint( check=models.Q(a__is_pure=True), name="a_is_pure" ) ] I want to add a constraint that no B instance can have a reference to an A instance that its is_pure field is False. When I add the above code, make migrations, and try to migrate, I get this error: (models.E041) 'constraints' refers to the joined field 'a__is_pure'. Does Django support such thing currently ? If not, what do you recommend? -
Why is django-money running incorrectly in my view?
I am using django-money to make conversions on my backend of the project but it is converting wrong. For example, I want to convert TRY to USD: I enter 1000000 TRY it returns 480629.66 USD, but it should be: 120055.20 USD. How can I solve it? views.py def customer(request): form_class = NewCustomerForm current_user = request.user userP = UserProfile.objects.get_or_create(username=current_user) company = userP[0].company if request.method == 'POST': # Create a form instance and populate it with data from the request (binding): form = NewCustomerForm(request.POST) # Check if the form is valid: if form.is_valid(): newCustomer = form.save() newCustomer.company = company selected_currency = newCustomer.currency_choice selected_limit = newCustomer.credit_limit newCustomer.usd_credit_limit = convert_money(Money(selected_limit, selected_currency), 'USD') cred_limit = newCustomer.usd_credit_limit value = str(cred_limit)[1:] # float_str = float(value) float_str = float(cred_limit.amount) newCustomer.credit_limit = float_str newCustomer.save() return redirect('user:customer_list') else: form = form_class() return render(request, 'customer.html', {'form': form}) forms.py class NewCustomerForm(forms.ModelForm): ... class Meta: model = Customer fields = ('customer_name', 'country', 'address', 'customer_number', 'phone_number', 'email_address', 'credit_limit', 'currency_choice', 'risk_rating', 'parent', 'entity') models.py class Customer(models.Model): ... CURRENCIES = [ ('USD', 'USD'), ('EUR', 'EUR'), ('GBP', 'GBP'), ('CAD', 'CAD'), ('CHF', 'CHF'), ('DKK', 'DKK'), ('PLN', 'PLN'), ('HUF', 'HUF'), ('CZK', 'CZK'), ('RUB', 'RUB'), ('KZT', 'KZT'), ('BGN', 'BGN'), ('RON', 'RON'), ('UAH', 'UAH'), ('TRY', 'TRY'), ('ZAR', 'ZAR'), ] .... currency_choice … -
React is not hiting django apis on kubernetes clustor
I am new to Kubernetes and this is my first time deploying a react-django web app to Kubernetes cluster. I have created: frontend.yaml # to run npm server backend.yaml # to run django server backend-service.yaml # to make django server accessible for react. In my frontend.yaml file I am passing REACT_APP_HOST and REACT_APP_PORT as a env variable and changed URLs in my react app to axios.get('http://'+`${process.env.REACT_APP_HOST}`+':'+`${process.env.REACT_APP_PORT}`+'/todolist/api/bucket/').then(res => { setBuckets(res.data); setReload(false); }).catch(err => { console.log(err); }) and my URL becomes http://backend-service:8000/todolist/api/bucket/ here backend-service is name of backend-service that I am passing using env variable REACT_APP_HOST. I am not getting any errors, but when I used kubectl port-forward <frontend-pod-name> 3000:3000 and accessed localhost:3000 I saw my react app page but it did not hit any django apis. On chrome, I am getting error net::ERR_NAME_NOT_RESOLVED and in Mozilla Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://backend-service:8000/todolist/api/bucket/. (Reason: CORS request did not succeed). Please help on this issue, I have spent 3 days but not getting any ideas. frontend.yaml apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null labels: app: frontend name: frontend spec: replicas: 1 selector: matchLabels: app: frontend strategy: {} template: metadata: creationTimestamp: null labels: app: frontend spec: … -
Django ForeignKey field ignored by graphene-django when "to" value is a string
Versions: Python: 3.8 Django: 3.2.2 graphene-django: 2.15.0 I have an issue when using graphene-django with a ForeignKey field is ignored because the value of to is a string. Here's the Django model: class CableTermination(models.Model): cable = models.ForeignKey( to='dcim.Cable', on_delete=models.SET_NULL, related_name='+', blank=True, null=True ) The value of to is a string to avoid a circular import. This is also the only field (apart from pk) on this model. I've created a DjangoObjectType from this class: class CableTerminationNodeType(DjangoObjectType): class Meta: model = CableTermination I also have a type for Cable: class CableNodeType(DjangoObjectType): class Meta: model = Cable But on startup I see this error: env/lib/python3.8/site-packages/graphql/type/definition.py", line 214, in define_field_map assert isinstance(field_map, Mapping) and len(field_map) > 0, ( AssertionError: CableTerminationNodeType fields must be a mapping (dict / OrderedDict) with field names as keys or a function which returns such a mapping. I've tracked this down to field_map having length 0. I have also observed that the converter for the above cable field is called but returns None. This is because field.related_model returns the string dcim.Cable but the registry can only lookup by class. So ultimately, _type is None below: @convert_django_field.register(models.OneToOneField) @convert_django_field.register(models.ForeignKey) def convert_field_to_djangomodel(field, registry=None): model = field.related_model def dynamic_type(): _type = registry.get_type_for_model(model) if … -
access to foreign key fields with fields name
I need access to foreign key fields with string fields name: for example: In a def in Document model , I need access to customer__customer_name [customer model -> customer_name field] Mycode: class Customer(LaundryModel, models.Model): customer_code = models.CharField(max_length=100, unique=True) customer_name = models.CharField(max_length=100) class Document(LaundryModel,models.Model): document_number = models.IntegerField(unique=True) date = models.DateTimeField(auto_now_add=True) customer = models.ForeignKey("customer.customer", on_delete=models.PROTECT, related_name='+') json_fields=["customer__customer_name", "customer__customer_code"] def send_email(self): ###### in this place Need access to customer_name and customer_name from customer foreign key ###### I try to this with getattr or values or another but not working -
I want to list all elements from abstract class Product and its categories (Smartphones, Tv ) etc
class ProductSerizer(serializers.ModelSerializer): category = serializers.PrimaryKeyRelatedField(queryset=Category.objects) title_of_product = serializers.CharField(required=True) slug = serializers.SlugField(required=True) image_of_product = serializers.ImageField(required=True) description_of_product = serializers.CharField(required=True) price_of_product = serializers.DecimalField(max_digits=12, decimal_places=2, required=True) class Product(models.Model): class Meta: abstract = True category = models.ForeignKey(Category, verbose_name="category", on_delete=models.CASCADE) title_of_product = models.CharField(max_length=225,verbose_name="Title",null=True) slug = models.SlugField(unique=True) image_of_product = models.ImageField(verbose_name="Image", null=True) description_of_product = models.TextField(verbose_name = "Descripwtion", null = True) price_of_product = models.DecimalField(max_digits=10,decimal_places=2, verbose_name="Price", null=True) and I want to list all elements from categories, but I cannot serialize this class. How should I do ? -
Sharing the session cookie between same site (using iframe). Django
A quite basic question. Consider this: I want them (only green) to share this sessionid cookie, so they both share request.session. Is it that possible? I log in on the left but then I don't see me logged in in the iframe, so I understand they are not sharing sessionid cookie. Why?? They are the same domain!! Thanks in advance! ;-) Note: I am using Django 1.11 and python 2.7 -
How can I delete an object from a m2m relationship without deleting all of them?
I'm trying to get my user to delete a 'favorite' item. The item is in the model Profile as a 'Favorite', which is a M2M relationship. However, when I try to delete the favorite item, all of them get deleted instead of one. How can I manage to delete only the object I select by its id instead and not all of them? This is the part of the view with the request that deletes all of them instead of one: if request.method=='POST' and 'favorite_id' in request.POST : favorite_id = request.POST.get("favorite_id") favorite = Favorite.objects.get(mal_id = favorite_id) favorite.delete() This is the html part: <div class="row"> {% for favorite in user.profile.favorites.all %} <form method="POST"> {% csrf_token %} <input type="hidden" value="{{ favorite.Id }}" name="favorite_id"> <button type="submit" class="btn btn-outline-danger" style="font-size:8px; border-radius: 50%">x</button> <div class="col-sm-12 col-md-6 col-lg-4 pb-4"> <div class="h-100"> <img src="{{ favorite.image }}" class="card-img-top" alt="{{ favorite.title }}" style="width: auto; height: 225px; object-fit: scale-down;"> <div class="card-body"> <h5 class="card-title">{{ favorite.title }}</h5> <p class="card-text text-muted" style="font-size:12px">Episodes: {{ favorite.episodes }}</p> </div> </div> </div> </form> {% endfor %} </div> The model: class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) favorites = models.ManyToManyField(Anime, related_name='favorited_by', null=True, blank=True) -
Not able to install "mysqlclient" package in python
(venv) C:\Users\Grv\PycharmProjects\Employee>pip install mysqlclient Collecting mysqlclient Using cached mysqlclient-2.0.3.tar.gz (88 kB) Using legacy 'setup.py install' for mysqlclient, since package 'wheel' is not installed. Installing collected packages: mysqlclient Running setup.py install for mysqlclient ... error ERROR: Command errored out with exit status 1: command: 'c:\users\grv\pycharmprojects\employee\venv\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Grv\\AppData\\Local\\Temp\\pip -install-i_sgg0o6\\mysqlclient_263511bdd06944be9431012ebadf8f3b\\setup.py'"'"'; __file__='"'"'C:\\Users\\Grv\\AppData\\Local\\Temp\\pip-install-i_sgg0o6\\mysqlclient_263511bdd06944be94310 12ebadf8f3b\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.rea d().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Grv\AppData\Local\Temp\pip-record-rk5je4if\install-record.txt ' --single-version-externally-managed --compile --install-headers 'c:\users\grv\pycharmprojects\employee\venv\include\site\python3.8\mysqlclient' cwd: C:\Users\Grv\AppData\Local\Temp\pip-install-i_sgg0o6\mysqlclient_263511bdd06944be9431012ebadf8f3b\ Complete output (29 lines): running install running build running build_py creating build creating build\lib.win32-3.8 creating build\lib.win32-3.8\MySQLdb copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb copying MySQLdb\_exceptions.py -> build\lib.win32-3.8\MySQLdb copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb creating build\lib.win32-3.8\MySQLdb\constants copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants running build_ext building 'MySQLdb._mysql' extension creating build\temp.win32-3.8 creating build\temp.win32-3.8\Release creating build\temp.win32-3.8\Release\MySQLdb C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(2,0,3,'final',0) -D __version__=2.0.3 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -Ic:\users\grv\pycharmprojects\employee\venv\include -IC:\Users\Grv\AppData\Local\Programs\Python\ Python38-32\include -IC:\Users\Grv\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" " -IC:\Program Files … -
Displayed Form PointField on my GeoDjango template
I cannot display the PointField map of the widget on my html file. I need help I want to index the position of the different company sites. On the admin page, there is no problem but at the level of the html file this is where there is a problem. Thank you model.py : class position(models.Model): title = models.CharField(blank=True,max_length=150) location = models.PointField(blank=True,geography=True,) address = models.CharField(blank=True,max_length=100) city = models.CharField(blank=True,max_length=50) def __str__(self): return self.title form.py : class PositionForm(forms.Form): title = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'title'})) address = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'address'})) city = forms.CharField(widget=forms.Select(attrs={'class': 'form-control', 'placeholder': 'city'},choices=CITY_CHOICES)) location = forms.PointField(widget=forms.OSMWidget( attrs={ 'map_width': 600, 'map_height': 400, 'template_name': 'gis/openlayers-osm.html', })) views.py : def create_position(request): if request.method == 'POST': form = PositionForm(request.POST) if form.is_valid(): data = position() data.title = form.cleaned_data['title'] # get product quantity from form data.location = form.cleaned_data['location'] data.address = form.cleaned_data['address'] data.city = form.cleaned_data['city'] data.save() # Create data in profile table for user messages.success(request, 'Your position has been created!') return redirect('/home/') else: messages.warning(request, form.errors) return redirect('/recognition/create_position/') form = PositionForm() context = { 'form': form, } return render(request, 'recognition/create_position.html', context) -
In Django I cannot retrieve the selected value from database its a dropdown in status field also cant retrieve the selected file in upload cv
this is my edit.html code I want to retrieve the selected value from database in status field its a dropdown also I have Upload cv which is a file field I want to retrieve the selected file too how can I do that I am not getting any solution <section class="site-section"> <div class="container"> <div class="row"> <div class="col-lg-12 mb-5"> <h2 class="mb-4 text-center">Update Candidate Details</h2> <form method="POST" action="/update/ {{i.id}}/" enctype="multipart/form-data" class="p-4 border rounded" onsubmit="myFunction()" > {% csrf_token %} {% comment %} <input type="hidden" name="csrfmiddlewaretoken" value="UabxqpD8HGPOu1ZSFnIHAPbMtRgWBAnVHEs8bLDx0HnxN6uhG3LyYvZShvcx1ekn"> {% endcomment %} <div class="row form-group"> <div class="col-md-12 mb-3 mb-md-0"> <label class="text-black" for="full_name">Full Name :</label> <input type="text" class="form-control" value ={{ i.full_name}} name="full_name" id="id_full_name" placeholder="Enter First Name"> </div> </div> <div class="row form-group"> <div class="col-md-12 mb-3 mb-md-0"> <label class="text-black" for="recruiter_name">Recruiter Name :</label> <input type="text" class="form-control" value ={{ i.recruiter_name }} name="recruiter_name" id="id_recruiter_name" placeholder="Enter Recruiter Name"> </div> </div> {% comment %} <div class="row form-group"> <div class="col-md-12 mb-3 mb-md-0"> <label class="text-black" for="id_last_name">Last Name :</label> <input type="text" class="form-control" name="last_name" id="id_last_name" placeholder="Enter Last Name"> </div> </div> {% endcomment %} <div class="row form-group"> <div class="col-md-12 mb-3 mb-md-0"> <label class="text-black" for="email">Email :</label> <input type="email" class="form-control" value ={{i.email }} name="email" id="id_email" placeholder="Enter Email"> </div> </div> <div class="row form-group"> <div class="col-md-12 mb-3 mb-md-0"> <label class="text-black" for="noticeperiod">Notice Period (in …