Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django generateschema ignores URLs
I am trying to learn to create a Backend with Django, together with an Angular frontend. In order to make the api a little more consistent I tried to create a API schema to use the OpenAPI Generator. I have run the command ./manage.py generateschema --file schema.yml. But: The yml file does not have any information about the users.url. I have added the get_schema_view from the rest_framework, with the same result. The (main) app urls.py looks like this: from django.conf.urls import include from django.contrib import admin from django.urls import path from rest_framework.schemas import get_schema_view urlpatterns = [ path('admin/', admin.site.urls), path('api/users/', include('users.urls'), name="users"), path('api/network/', include('networkController.urls'), name="network"), path('api/files/', include('fileController.urls'), name="files"), path('api/', get_schema_view( title="API Documentation", description="API for all things" ), name='openapi-schema') ] The networkController.urls looks like this: from django.urls import path from . import views urlpatterns = [ path('', views.startNetwork) ] which is found by the schema generator. The users.urls looks like this: from django.urls import path from . import views urlpatterns = [ path('login/', views.login), path('register/', views.registerUser) ] I have tried to move all urls to the (main) backend.urls and include the views directly, I have tried "layering" them all. # backend.urls: path('api/', include('api.urls')) # api.urls: path('users/', include('users.urls')) without any changes. I … -
Is there an equivalent to python3 manage.py shell in Hibernate?
In django, you can create objects for your API to be stored in the database and then play around with the API after running the python3 manage.py shell command. Is there a way to do this in Hibernate? Or am I just stuck writing unit tests, to test everything out? -
Get City and Country Dropdown list Django
I am trying to create a dependent dropdown list of countries and cities, based on the country selected I want to have another drop-down of cities in that country. In my Django model without creating models for country and city. Here is my code: models.py from django.db import models from django_countries.fields import CountryField from partial_date import PartialDateField class School(models.Model): school_name = models.CharField(max_length = 30) school_country = CountryField() school_city = ?? school_population = models.IntegerField() school_description = models.TextField(max_length = 300) year_build = PartialDateField() total_branches = models.IntegerField() school_fees = models.IntegerField() school_images = models.FileField(default=None) def __str__(self): return self.school_name I was able to get countries using django-countries school_country = CountryField() but I have no idea how to do the same for cities. I looked at django-cities but I didn't understand how to use it -
Django Template js static files fail to load
Its been a very long time since I had to use Django templates but I am having some trouble loading static js files. My structure is as follows: Project > static > js > main.js in the template I have <script type="text/javascript" src="{% static 'js/main.js' %}"></script> I do have {% load static %} at the top of the html file and also here are my settings STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) Can someone please enlighten me as to what am I missing? -
Django Rest Framework User owned object: modifying a related object
Suppose I have models like: class Book(models.Model): title = models.CharField(max_length=254) user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) class Chapter(models.Model): title = models.CharField(max_length=254) book = models.ForeignKey(Book, on_delete=models.CASCADE) Suppose user A creates book. I can restrict access to the book from user B in the Book viewset by overriding get_queryset: def get_queryset(self): user = User.objects.get(username=self.request.user.username) queryset = Book.objects.filter(user=user) return queryset I also have an endpoint for adding chapters: class ChapterViewSet(viewsets.ModelViewSet): queryset = Chapter.objects.all() serializer_class = serializers.ChapterSerializer model = Chapter I want to prevent user B from adding (creating, POST) a chapter to a book created by user A. What is the best practice for creating this restriction? -
Django and File DSN: How to Connect?
I have a need to use a file DSN to connect to a database. Is it possible for Django to connect to a database with a file DSN? If so, how do I config it? This is my current setting: DATABASES['OrgChartWrite'] = { 'ENGINE': 'sql_server.pyodbc', 'HOST' : server_name, 'NAME' : database_name, 'AUTOCOMMIT' : True, 'ATOMIC_REQUESTS' : True, 'OPTIONS' : { 'driver' : 'SQL Server Native Client 11.0', }, } And this is the file: -
The time in influxdb comes in utc what should i do for UTC+3?
I set the time as utc+3 (europe/istanbul) in the database. The data I get from the device looks correct in influxdb, but when I pull data from influxdb to html, it shows as UTC without the time set. I pull the queries like this. When I add the TZ(Europe/Istanbul) method to the end of the query, I get an error.I need the What should i do ? temp = client.query("SELECT * From device_frmpayload_data_Temp WHERE time > now() - 7d ORDER BY time DESC") hum = client.query("SELECT * From device_frmpayload_data_Hum WHERE time > now() - 7d ORDER BY time DESC") air = client.query("SELECT * From device_frmpayload_data_Air WHERE time > now() - 7d ORDER BY time DESC") In my settings.py also i set (Europe/Istanbul). -
Django custom user cant use signals with custom User
Have a look at my custom User and user profile class Users(AbstractUser): username = None email = models.EmailField(unique=True, null=False, db_column='email') is_staff = models.BooleanField(default=False, db_column='is_staff') is_active = models.BooleanField(default=False, db_column='is_active') date_joined = models.DateTimeField(default=timezone.now, db_column='date_joined') updated_at = models.DateTimeField(auto_now=True, auto_now_add=False, db_column='updated_at') USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['first_name', 'last_name'] objects = UsersManager() def __str__(self): return self.email class Meta: db_table = 'mn_users' verbose_name = 'user' verbose_name_plural = 'users' class UserProfiles(models.Model): user_profile_id = models.AutoField(primary_key=True, db_column='user_profile_id') user_id = models.OneToOneField('Users', on_delete=models.CASCADE, db_column='user_id') photo = CloudinaryField('image') msisdn = models.CharField(max_length=12, null=True, blank=True, unique=True, db_column='msisdn') nationality_id = models.ForeignKey(Nationalities, related_name='nationalites2userprofiles', null=True, blank=True, on_delete=models.PROTECT, db_column='nationality_id') language_id = models.ForeignKey(Languages, related_name='preferred_languages2users', null=True, blank=True, on_delete=models.PROTECT, db_column='language_id') created_at = models.DateTimeField(auto_now=False, auto_now_add=True, db_column='created_at') updated_at = models.DateTimeField(auto_now=True, auto_now_add=False, db_column='updated_at') def __str__(self): return self.role_id class Meta: db_table = 'mn_user_profiles' verbose_name = 'user_profile' verbose_name_plural = 'user_profiles' So I am using Django rest framework to create the user and this is working properly. Issue is I want a user Profile created when a user is created. For this i made a signals file in users/signals.py from django.db.models.signals import post_save from django.dispatch import receiver from .models import Users, UserProfiles @receiver(post_save, sender=Users) def create_profile(sender, instance, created, **kwargs): if created: UserProfiles.objects.create(users=instance) @receiver(post_save, sender=Users) def save_user_profile(sender, instance, **kwargs): instance.profile.save() I then added the above to the users/app.py … -
How to annotate a field with information from a specific manytomany entity?
I have 2 models and a manytomany relationship between then, Property and Owners, they are pretty much the following: class Property(models.Model): name = models.CharField(max_length=50) owners = models.ManyToManyField('Owner', through='PropertyOwner') ... class Owner(models.Model): name = models.CharField("Owner's name", max_length=50) ... class PropertyOwner(models.Model): property = models.ForeignKey('Property', on_delete=models.CASCADE) owner = models.ForeignKey('Property', on_delete=models.CASCADE) current = models.BooleanField() How can annotate a new field in my Property.objects.all() queryset with the current owner's id. (maybe using .first()) -
Is it possible to modify intermediate model in ManyToManyField relation in Django?
Suppose I did something like the following to establish a many-to-many relationship between two models: class Publication(models.Model): title = models.CharField(max_length=30) class Article(models.Model): headline = models.CharField(max_length=100) publications = models.ManyToManyField(Publication) Now I'd like to add some extra fields to the many-to-many relationship. I was looking for and I find I can do something like this: class Publication(models.Model): title = models.CharField(max_length=30) class Article(models.Model): headline = models.CharField(max_length=100) publications = models.ManyToManyField(Publication, through='Enrollment', through_fields=('article', 'publication')) class Enrollment(models.Model): article = models.ForeignKey(Article, on_delete=models.CASCADE) publication = models.ForeignKey(Publication, on_delete=models.CASCADE) date_joined = models.DateField(null=True, default=None, blank=True) class Meta: unique_together = [['article', 'publication']] but, how there is a way to add some extra fields and preserve all previous relations? -
What is better to use Class of Def in views
I have a question that bothers me. What is better to use in django views? Classes or defs? And if both, so when using it? When to deviate from a given method. -
Django models for creating multiple variations of t-shirts
I'm creating an ecommerce store that sells T-shirts, hoodies, mugs, shot glasses, etc. For the t-shirts and hoodies there are sizes and sometimes color associated with each product. I'm trying to add multiple variations for each product. Here's my model.py code: class Category(models.Model): name = models.CharField(max_length = 255, db_index=True, null=True, blank=True) slug = models.SlugField(max_length=255, unique=True, default='') class Meta: verbose_name_plural = 'categories'\ def get_absolute_url(self): return reverse('main:category_list', args=[self.slug]) def __str__(self): return self.name class Attribute(models.Model): name = models.CharField(max_length = 255, default='') def __str__(self): return self.name class ProductAttribute(models.Model): attribute = models.ManyToManyField(Attribute, through='Product') value = models.CharField(max_length = 255, null=True, blank=True) def __str__(self): return self.value class Product(models.Model): category = models.ForeignKey(Category, on_delete=models.CASCADE, null=True, blank=True) name = models.CharField(max_length = 255, default='') description = models.TextField(blank=True) image = models.ImageField(upload_to='products/', null=True, blank=True) slug = models.SlugField(max_length = 255, default='') price = models.DecimalField(max_digits=4,decimal_places=2) has_attributes = models.BooleanField(default=False) attribute = models.ForeignKey(Attribute, on_delete=models.CASCADE, null=True, blank=True) value = models.ForeignKey(ProductAttribute, on_delete=models.CASCADE, null=True, blank=True) class Meta: ordering=(['name']) def get_absolute_url(self): return reverse('main:product_detail', args=[self.slug]) def __str__(self): return self.name The way it appears right now in my admin interface there is a name, attribute, value, and price (only named relevant fields for clarity). If I add a product like such: "t-shirt_1, size, sm, 17.98", then the next item I need to add … -
Hi everyone, i'm using django and trying to display a picture from my database, but am unable to
Most of the code I use is from this article: (copied from https://www.etutorialspoint.com/index.php/356-how-to-display-image-from-database-in-django) This is my code: My model("ingredient") uses: title = models.CharField(max_length=50, primary_key=True) pictureLink = models.ImageField(upload_to="media") The pictureLink I provided in my database is: C:\Users"Me"\Desktop"project"\image\leaves.png My views.py contains: def say_hello(request): allimages = Ingredient.objects.all() return render(request, 'hello.html',{'images' : allimages}) My HTML code is the following: {% for img in images %} <tr> <td>{{img.title}}</td> <td><img src="{{ingredient.pictureLink.url}}" width="120"/></td> </tr> {% endfor %} In settings.py I put the following: BASE_DIR = Path(file).resolve().parent.parent MEDIA_ROOT = os.path.join(BASE_DIR, 'image') MEDIA_URL = '/image/' Does anyone know where i'm making a mistake? I'm a beginner with Django, so all feedback is appreciated! -
How to best pass converted values of a Django model to context?
I have a model Poller that has a bunch of integer fields. I have a function convert_thousands that converts integer figures into short strings like so: convert_thousands(1300000) # Returns '1,3 m' etc. How to best convert alle of the integer fields and pass them into the context? Right now I'm doing it one by one by one..: Foo = convert_thousands(poller.integerfield_one) Bar = convert_thousands(poller.integerfield_two) [..] context = { 'poller': poller, 'Foo': Foo, 'Bar': Bar [..] } Desired outcome would look s.th. like [..] context = { 'poller': poller, 'converted_strings': converted_strings } and render by {{ converted_strings.integerfield_one }} -
How to get Django to redirect to the requested page with the LoginRequiredMixin after logging in?
Background: I have an inventory application that scrapes through our VM and storage environments to index things for my team to have some quick references without having to log into vCenter/Storage systems directly to get info. Since it's dealing with some potentially sensitive info, I put authentication on it by way of using the LoginRequiredMixin in my Views classes. The authentication part has been in for a while and it works without issues. The part where I get stuck on is I implemented the next parameter in the login form, and it shows up in the URL when it prompts to login. I have a different view class for each kind of thing I'm tracking. Goal: When someone clicks on a link that requires authentication (basically every page except the main page), it redirects them to the page they want after requiring them to login. I've seen a few other questions, but the recommendations mentioned haven't worked in my case for whatever reason. I've tried various implements of the redirect_field_name but it still ends up trying to redirect to /accounts/profile if I don't have it overridden in the settings page. I don't have the login_url field set, but the login … -
Django School management system
I want to develop a School management system using Flutter as frontend and django as backend. I'm pretty confused about some things: How do I construct my models so that, students and teachers will be specific to a particular school (so i can have up to 10 schools without having conflicts getting data from the database)? What is the best site to host my app? -
Directs messages in django
I followed a tutorial that shows how to send DMs. there is a way to start a new conversation. but the problem is that with each new conversation it sends 'hello guys'. I want the user to be able to put the message he wants. here is the function new_conversation views.py def new_conversation(request, username): user_sender = request.user message_body = 'Hello guys !' try: user_receiver = User.objects.get(username=username) except Exception as e: return redirect('search-inbox') if user_sender != user_receiver: Message.send_message(user_sender, user_receiver, message_body) return redirect('inbox') how to use a method to input the message ? And also i would like to know what the "except Exception as e" is for, i think that except only would have been enough -
How to force one and only one of two fields to be required in Django?
So here is a Django model example: from django.db import models from django.core.exceptions import ValidationError class MyModel(models.Model): field1 = models.CharField(null=True) field2 = models.CharField(null=True) def clean(self): if self.field1 and self.field2: raise ValidationError( 'Please select only field1 OR field2, not both.') elif self.field1 is None and self.field2 is None: raise ValidationError( 'Please select field1 or field2.') What I want to achieve is to force an admin of my app to choose one and only one field from two which are available. The problem is that my code prevents well against adding new object with both fields chosen, but it does not prevent against adding new object with no fields chosen; the second part works only while admin wants to edit the object without neither field1 nor field2, but it is possible to add it in the first place, which I wish to prevent against. Any ideas how can I fix this? -
How do I create a dependent dropdown form in Django
I've searched far and wide for an answer to this question with no success. I would like to create a simple dependent dropdown form in Django. The first field is to be a 'workout' that is to be selected and the second field should be of models.PositiveIntergerField() with some validators in it coming from the django.core.validators module. I would like this integer to be dependent on the amount of 'exercises' within the chosen 'workout' (exercise has a foreign key to workout). Once a user selects a workout, the amount of exercises is dependent on how many exercises are actually under that workout. So far, I have been able to get the first field but not the integer field. Below are the forms.py, views.py, model.py, and routine.html of my application. forms.py - have it set to where a user can only see the workouts & exercises they have created from django import forms from .models import Workout, Exercise, Routine class RoutineForm(forms.ModelForm): """creates a form for a routine""" def __init__(self, *args, user=None, **kwargs): super().__init__(*args, **kwargs) self.fields['workout'].queryset = Workout.objects.filter(owner=user) class Meta: model = Routine fields = ['workout'] labels = {'workout': '',} views.py from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from .models … -
Django: div class alert alert-danger does not work properly
My forms.py: class SignUpForm(forms.ModelForm): name = forms.CharField(label="name", required=True, widget=forms.TextInput()) email = forms.CharField(label="email", required=True, widget=forms.TextInput()) password = forms.CharField(label="password", widget=forms.PasswordInput(), required=True) confirm_password = forms.CharField(label="password", widget=forms.PasswordInput(), required=True) def clean(self): cleaned_data = super(SignUpForm, self).clean() password = cleaned_data.get("password") confirm_password = cleaned_data.get("confirm_password") if password != confirm_password: self.add_error('confirm_password', "Password and confirm password do not match") return cleaned_data class Meta: model = get_user_model() fields = ('name', 'email', 'password') My html file: {% block content %} <form method="post"> <div class="sign-card"> <h3>Signup</h3> {% csrf_token %} <div class="input-div"> <label for="{{ form.name.id_for_label }}">Username:</label> {{ form.name }} </div> <div class="input-div"> <label for="{{ form.email.id_for_label }}">Email:</label> {{ form.email }} </div> <div class="input-div"> <label for="{{ form.password.id_for_label }}">Password:</label> {{ form.password }} </div> <div class="input-div"> <label for="{{ form.password.id_for_label }}">Confirm Password:</label> {{ form.confirm_password }} </div> {% if form.errors %} {% for field in form %} {% for error in field.errors %} <div class="alert alert-danger"> <strong>{{ error|escape }}</strong> </div> {% endfor %} {% endfor %} {% endif %} <button type="submit" class="btn">Sign up</button> <p>Already have account? <a href="{% url 'login' %}">Log In</a></p> </div> </form> {% endblock %} My views.py: def signup(request): if request.method == 'POST': form = SignUpForm(request.POST) if form.is_valid(): form.save() username = form.cleaned_data.get('name') password = form.cleaned_data.get('password') email = form.cleaned_data.get('email') user = authenticate(username=username, password=password, email=email) login(request, user) return redirect('index') else: form … -
Filter multiple generic related fields from the same model in djang rest framework
I have two models that correlate each other with GenericRelation(). class Translation(models.Model): """ Model that stores all translations """ content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, null=True, blank=True) object_id = models.CharField(max_length=50, null=True, blank=True) content_object = GenericForeignKey() lang = models.CharField(max_length=5, db_index=True) field = models.CharField(max_length=255, db_index=True, null=True) translation = models.TextField(blank=True, null=True) class Meta: ordering = ['lang', 'field'] unique_together = (('content_type', 'object_id', 'lang', 'field'),) class Tags(models.Model, Translatable): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) DISEASE = 0 TYPE = [(DISEASE, 'disease')] type = models.PositiveSmallIntegerField(choices=TYPE) name = GenericRelation(Translation) description = GenericRelation(Translation) I am trying to create and filter two fields that have generic relation with the model Translation. class TranslationSerializer(serializers.ModelSerializer): """ Translation serializer to be nested into other serializers that needs to display their translation. """ class Meta: model = Translation fields = "__all__" class TagsSerializer(WritableNestedModelSerializer): name = TranslationSerializer(required=False, many=True) description = TranslationSerializer(required=False, many=True) class Meta: model = Tags fields = ['id', 'type', 'name','description'] def create(self, validate_data): """ Create nested translation. content_type and object_id are added dynamically. """ names = validate_data.pop('name') description = validate_data.pop('description') tags = Tags.objects.create(**validate_data) for n in names: model = self.Meta.model content_type = ContentType.objects.get_for_model(model) n['content_type'] = content_type.id n['object_id'] = tags tags.name.create(**n) for desc in description: model = self.Meta.model content_type = ContentType.objects.get_for_model(model) desc['content_type'] = content_type.id n['object_id'] = … -
Django Rest Framework, How to CREATE or UPDATE object that has a nested serializer as one of its fields
I have two models Product and Variant as follows models.py class Product(models.Model): GENDER = [ ('M', 'male'), ('F', 'female'), ('U', 'unisex'), ] store = models.ForeignKey( Store, on_delete=models.CASCADE, related_name='products') name = models.CharField(max_length=80) slug = models.SlugField(max_length=200, unique=True, blank=True, null=True) description = models.TextField() brand = models.CharField(max_length=200, blank=True, null=True) model = models.CharField(max_length=200, blank=True, null=True) gender = models.CharField(max_length=20, choices=GENDER) image_1 = models.URLField() image_2 = models.URLField() category = models.ForeignKey( 'Category', related_name="products", on_delete=models.CASCADE, null=True, blank=True) return_policy = models.IntegerField(null=True, blank=True) in_warehouse = models.BooleanField(default=False) is_approved = models.BooleanField(default=False) is_rejected = models.BooleanField(default=False) is_disabled = models.BooleanField(default=False) is_deleted = models.BooleanField(default=True) score = models.IntegerField(default=0) created_at = models.DateTimeField(default=timezone.now) updated_at = models.DateTimeField(null=True, blank=True) def __str__(self): return self.name class Variant(models.Model): product = models.ForeignKey( Product, on_delete=models.CASCADE, related_name="variants", null=True, blank=True) is_default = models.BooleanField(default=False) price = models.FloatField() old_price = models.FloatField(blank=True, null=True) quantity = models.IntegerField() image = models.URLField() is_deleted = models.BooleanField(default=True) created_at = models.DateTimeField(default=timezone.now) updated_at = models.DateTimeField(null=True, blank=True) def __str__(self): return self.product.name + " variant" I would like to CREATE a product while passing a list of variants so it can automatically create the variants with the product as follows serializer.py class VariantSerializer(serializers.ModelSerializer): image = serializers.ImageField() class Meta: model = Variant fields = ['product', 'is_default', 'price', 'old_price', 'quantity', 'size', 'shoe_size', 'color', 'image'] class ProductSerializer(serializers.ModelSerializer): variants = VariantSerializer(many=True) image_1 = serializers.ImageField() image_2 … -
Inherit Django choice class to extend it?
I have a field in my models.py that accepts choices determined in a class: from apps.users.constants import UserChoices class User(models.Model): choices = models.CharField(max_length=10, blank=True, choices=UserChoices.choices(), default=UserChoices.PUBLIC) The choice class is this: from django.utils.translation import ugettext_lazy as _ class UserChoices: PRIVATE_USER = "private_user" PUBLIC_USER = "public_user" @classmethod def choices(cls): return ( (cls.PRIVATE_USER, _("Private User)), (cls.PUBLIC_USER, _("Public User"), ) My doubt is how can I inherit this UserChoices class to another choice class, in order to extend it with another options. I tried the following: class ExtendedChoices(UserChoices): OTHER_CHOICE = "other_choice" @classmethod def choices(cls): return ( UserChoices.choices(), (cls.OTHER_CHOICE, _("Other choice")), ) But it gives me a migration error: steps.StepVisibility.gender: (fields.E005) 'choices' must be an iterable containing (actual value, human readable name) tuples. Obviously this example is simplified, the actual code has 40+ choices on the original class and 20+ in the extended one. -
Error running WSGI application , ModuleNotFoundError: No module named 'mysite'. Also Not able to find Static files
I'm trying to deploy my website using pythonanywhere. I've given the correct path in wsgi file which is as follows (see code below). Still I'm Getting No module found error (as title of the post). Also it's not able to find Static files ,however they are at correct location. Wsgi file code { path = '/home/divyanshu964/portfolio/Personal_portfolio/' if path not in sys.path: sys.path.insert(0, path) os.environ['DJANGO_SETTINGS_MODULE'] = 'Personal_portfolio.settings' from django.core.wsgi import get_wsgi_application application = get_wsgi_application() } Help?? Thanks:) -
my css of update page not loading correctly but other page are working very fine
When I try to render template passing argument with primary key or ID CSS not loading as expected but when I try to render it simply with a request without passing id arg it loads perfectly. viewsy.py def update_lead(request,pk): leads = Lead.objects.get(id = pk) followup = Followup.objects.all agent = Agent.objects.all source = Source.objects.all print(f"the leads are {leads}") context = {"lead":leads,"followup":followup,"agent":agent,"source":source} return render(request,"home/update_lead.html",context) This is how looks at the frontend when I try passing id with my view it is not loading the css which is expepcted it is showing error but if we just remove the use of pk then the css will be loading and it is supposed to look like here is my templates code {% extends 'base.html' %} {% block body %} <div class="container"> <h2>Create Lead</h2> <form action="creat_handle_lead" method="POST"> {% csrf_token %} <div class="form-row"> <div class="form-group col-md-6"> <label for="inputEmail4">Name</label> <input type="text" class="form-control" id="inputEmail4" required name="name" value="{{lead.name}}"> </div> <div class="form-group col-md-6"> <label for="inputPassword4">Subject</label> <input type="text" class="form-control" id="inputPassword4" name="subject" required value="{{lead.subject}}"> </div> </div> <div class="form-row"> <div class="form-group col-md-6"> <label for="inputAddress">Email</label> <input type="email" class="form-control" id="inputAddress" name="email" placeholder="abc@email.com" value="{{lead.email}}"> </div> <div class="form-group col-md-6"> <label for="inputAddress2">Contact Number</label> <input type="number" class="form-control" id="inputAddress2" name="number"value = "{{lead.number}}" placeholder="99XX80XXXX"> </div> </div> <div class="form-row"> <div class="form-group col-md-4"> …