Is it possible without reloading the page to create a dependent selects in django?

Good day!
The essence of the following.
There are several related via FK of MySQL tables: Country, Federal districts, Regions and Cities.
class Country(models.Model):
 country_name = models.CharField(max_length=200, verbose_name='Country')

 def __unicode__(self):
 return self.country_name

 class Meta:
 verbose_name = 'country'
 verbose_name_plural = 'Countries'

class District(models.Model):
 district_name = models.CharField(max_length=100, verbose_name='Distrito Federal')
 district_country = models.ForeignKey('Country', verbose_name='the subjection of the country')

 def __unicode__(self):
 return self.district_name

 class Meta:
 verbose_name = 'Distrito Federal'
 verbose_name_plural = 'Federal district'

The data from this table and some other deduce through
def CabinetView(request, id):
 cab = Cabinet.objects.all().filter(id=id) #Return a list of the relevant offices
 cab_type = CabinetTypes.objects.all() #... their types
 country = country.objects.all() #... a list of countries
 district = District.objects.all() #... a list of fed. districts
 region = Region.objects.all() #... the list of areas
 city = City.objects.all() #...list of cities
 rendering = {
 'cab': cab
 'cab_type': cab_type,
 'country': country,
 'district': district,
 'region': region,
 'city': city,
 return render_to_response('cabinet.html', rendering)

in template form, where must be dependent selects s:

<!-- cabinet.html -->


 <select name="cab_coutry" class="forinput_edit" id="select-1">
 {% for i in country %}
 <option value="{{ }}" required>{{ i.country_name }}</option>
 {% endfor %}

 Federal district

 <select name="cab_district" class="forinput_edit" id="select-2">
 {% for i in district %}
 <option value="{{ }}" required>{{ i.district_name }} ({{ i.district_sname }})</option>
 {% endfor %}


Form needs work the idea is this: when you select country without page reload in the following select needs to load the list fed. districts linked to the selected country. And so on. Podruzhilsya the list of districts - the following selects the Ohm load the list of regions and then cities in the selected region. 4 selects a dependent.

Is it possible to implement such means django? Despite the fact that on the Internet there are many sites where you have implemented such a system, information about the implementation is quite scarce.
July 4th 19 at 23:37
1 answer
July 4th 19 at 23:39
One of django there is not enough, you need ajax.

Find more questions by tags DjangoHTMLMySQL