Category : django-templates

What is the difference between request.POST.get and request.GET.get in Django. I understand that when you use request.POST.get, you are trying to get data from front-end. In what situations will you require request.GET.get I know the difference between POST and GET, but in this context are there any additional differences? Source: Python..

Read more

This is challenge page When we go to ide page using the challenge button on the bottom and then click on submit button there then data is getting stored in database and function is running fine. But when I click on accept button and go to ide page and then click submit then data is ..

Read more

This is the error I am getting when I click on submit button from django.conf.urls import url,include from django.urls import path,re_path from . import views app_name = ‘challengeide’ urlpatterns = [ path(‘challengeide/<int:sr_no>’, views.show, name=’show’), url(‘challengeide/’, views.qtn,name=’test’), path(‘#’, views.submit_button,name=’submit_button’), url(‘challenge/’, views.challengeide, name=’challengeide’), ] This is my URL code <form method="POST" action="{% url ‘challengeide:submit_button’ %}" name="mybtn123">{% csrf_token ..

Read more

I’m trying to display a basic form in django but does not render the form once I run the server, I would appreciate if you could help me with these, here my code. models.py STATUS_OPTIONS =( (‘OP’, ‘OPEN’), (‘CL’, ‘CLOSED’) ) class Employee(models.Model): id = models.AutoField(primary_key=True) first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) email = models.EmailField(max_length=200) ..

Read more

How can I display only the history of Bids for each specific listing? Right now my page shows all the Bids history no matter for what listing on the website Models.py class AuctionListing(models.Model): title = models.CharField(max_length=100) description = models.TextField() start_bid = models.IntegerField(null=True) image = models.CharField(max_length=1000, blank=True) category = models.CharField(max_length=100) seller = models.CharField(max_length=100, default="Default_Value") def __str__(self): ..

Read more

AttributeError ‘NoneType’ object has no attribute ‘append’ def func(request): if request.method == ‘POST’: html = request.POST.get(‘html’) email = request.POST.get(’email’) first_html = BeautifulSoup(html, features=’html.parser’) second_html = BeautifulSoup(”.join(open(‘file1.html’))) for element in second_html: first_html.body.append(copy.copy(element)) I am trying to concatenate 2 html using Beautiful Soup, However i receive an error in the line: first_html.body.append(copy.copy(element)) why is this the case ..

Read more