Thank once again. I followed the instruction but i am not getting any changes.
Can you please see the error.
models.py
from django.db import models
# from django import forms
# from django_select2.forms import ModelSelect2MultipleWidget
class Continent(models.Model):
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class Country(models.Model):
continent = models.ForeignKey(Continent,on_delete=models.CASCADE)
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class Location(models.Model):
continent = models.ForeignKey(Continent,on_delete=models.CASCADE)
country = models.ForeignKey(Country,on_delete=models.CASCADE)
city = models.CharField(max_length=50)
street = models.CharField(max_length=100)
def __str__(self):
return self.name
------------------------------------------------------
admin.py
from django.contrib import admin
from .models import Continent,Country, Location
admin.site.register(Country)
admin.site.register(Location)
admin.site.register(Continent)
# Register your models here.
-----------------------------------------------------------------------
setting.py
Application definition
INSTALLED_APPS = [
'django_select2',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'newapp', #My App Name
]
------------------------------------
I downloaded PAckage