mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-06-11 09:03:12 +03:00
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. ```
This commit is contained in:
parent
0b2cc4ecb2
commit
9a60589732
|
@ -35,6 +35,7 @@ Now sync your database for the first time:
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
|
cd ..
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
|
|
||||||
Let's create a few simple models...
|
Let's create a few simple models...
|
||||||
|
@ -77,6 +78,18 @@ Add ingredients as INSTALLED_APPS:
|
||||||
"cookbook.ingredients",
|
"cookbook.ingredients",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Make sure the app name in ``cookbook.ingredients.apps.IngredientsConfig`` is set to ``cookbook.ingredients``.
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
# cookbook/ingredients/apps.py
|
||||||
|
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class IngredientsConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'cookbook.ingredients'
|
||||||
|
|
||||||
Don't forget to create & run migrations:
|
Don't forget to create & run migrations:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user