Как определить переменную окружения DJANGO_SETTINGS_MODULE?
Я пытаюсь применить chainedForeignKey с помощью https://django-smart selects.readthedocs.io/en/latest/installation.htmland я получил следующую ошибку :
`
django.core.exceptions.ImproperlyConfigured: Requested setting USE_DJANGO_JQUERY, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
`
ваш текст``from django.db import models
ваш текстfrom smart_selects.db_fields import ChainedForeignKey
Создавайте свои модели здесь.
your text
class City(models.Model):
your text
name = models.CharField(max_length = 25, null = True)
your text
class Area(models.Model):
your text
name = models.CharField(max_length = 25, null = True)
your text
city = models.ForeignKey(City, on_delete = models.CASCADE)
your text
class Store(models.Model):
your text
store = models.CharField(max_length = 50)
your text
city = models.ForeignKey(City, on_delete = models.CASCADE)
your text
area = ChainedForeignKey(Area, chained_field='city', chained_model_field='city')