我有一些看起来像这样: pages = Page.objects.prefetch_related("sections","sections__tiles").all()
for page in pages:
for section in page.sections.all():
for tile in section.tiles.all():
print t
我有两个型号: models.py class City(models.Model):
title = models.CharField(max_length=255)
show = models.BooleanField(default=True)
class Company(models.Model)
title = models.CharField(max_
我想在Django中设置缓存,但它不会让我定义默认缓存。 我不是太在意我使用什么类型的缓存 但是,即使复制粘贴+他们的榜样代码中的错误检查器告诉我(我曾经尝试Filesystem和Database缓存): ?: (caches.E001) You must define a 'default' cache in your CACHES setting.
我也尝试将CACHES设置放在setti