Skip to content

Commit 9a60589

Browse files
authored
Make instructions runnable without tweaking (#1224)
Introduces two changes to make sure the instructions in the tutorial don't require debugging: - Add `cd ..` when first syncing the database so that `manage.py` is accessible in the working directory. - Change `cookbook.ingredients.apps.IngredientsConfig.name` to `cookbook.ingredients` from `ingredients` to prevent the following exception: ```python django.core.exceptions.ImproperlyConfigured: Cannot import 'ingredients'. Check that 'cookbook.ingredients.apps.IngredientsConfig.name' is correct. ```
1 parent 0b2cc4e commit 9a60589

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/tutorial-plain.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Now sync your database for the first time:
3535

3636
.. code:: bash
3737
38+
cd ..
3839
python manage.py migrate
3940
4041
Let's create a few simple models...
@@ -77,6 +78,18 @@ Add ingredients as INSTALLED_APPS:
7778
"cookbook.ingredients",
7879
]
7980
81+
Make sure the app name in ``cookbook.ingredients.apps.IngredientsConfig`` is set to ``cookbook.ingredients``.
82+
83+
.. code:: python
84+
85+
# cookbook/ingredients/apps.py
86+
87+
from django.apps import AppConfig
88+
89+
90+
class IngredientsConfig(AppConfig):
91+
default_auto_field = 'django.db.models.BigAutoField'
92+
name = 'cookbook.ingredients'
8093
8194
Don't forget to create & run migrations:
8295

0 commit comments

Comments
 (0)