From ea4ddc7f7908e6e5cff54a94ccae98450d1cc681 Mon Sep 17 00:00:00 2001 From: Martijn Faassen Date: Thu, 18 Jan 2018 16:46:08 +0100 Subject: [PATCH] Adjustments to make it work with Django 2.0.1 I tried the tutorial but ran into these two problems in Django 2.0.1. --- docs/tutorial-plain.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/tutorial-plain.rst b/docs/tutorial-plain.rst index eca7904..cf877eb 100644 --- a/docs/tutorial-plain.rst +++ b/docs/tutorial-plain.rst @@ -68,7 +68,8 @@ Let's get started with these models: class Ingredient(models.Model): name = models.CharField(max_length=100) notes = models.TextField() - category = models.ForeignKey(Category, related_name='ingredients') + category = models.ForeignKey(Category, related_name='ingredients', + on_delete=models.CASCADE) def __str__(self): return self.name @@ -80,7 +81,7 @@ Add ingredients as INSTALLED_APPS: INSTALLED_APPS = [ ... # Install the ingredients app - 'ingredients', + 'cookbook.ingredients', ] Don't forget to create & run migrations: