I've been stuck to this problem from one week. I have read Django Doc. and i found little bit relevant to my problem.
from django import forms
class NameForm(forms.Form):
city_name = forms.CharField(label='city name', max_length=100)
from django.http import HttpResponseRedirect
from django.shortcuts import render
from .forms import NameForm
def get_name(request):
if request.method == 'POST':
form = NameForm(request.POST)
# Here i wanted to extract value stored inside Text Box How i can do that?
#i wanted to extract city entered by user and store into another variable how to do it?
# i wanted to use that variable to put it for filter
info = Data.objects.filter(city__exact='city')
above line is for retrieving record for entered city from database.
return render(request, 'name.html', {'info': info})
else:
form = NameForm()
return render(request, 'name.html', {'form': form})