Fix install ingredients app

You need the app installed for the migrations
This commit is contained in:
Jesus Mª 2017-07-17 23:51:21 +02:00 committed by GitHub
parent 0588f89b89
commit e425758f5b

View File

@ -73,12 +73,23 @@ Let's get started with these models:
def __str__(self): def __str__(self):
return self.name return self.name
Add ingredients as INSTALLED_APPS:
.. code:: python
INSTALLED_APPS = [
...
# Install the ingredients app
'ingredients',
]
Don't forget to create & run migrations: Don't forget to create & run migrations:
.. code:: bash .. code:: bash
python manage.py makemigrations python manage.py makemigrations
python manage.py migrate python manage.py migrate
Load some test data Load some test data
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
@ -96,9 +107,6 @@ following:
Installed 6 object(s) from 1 fixture(s) Installed 6 object(s) from 1 fixture(s)
Note:
If your run ``$ python ./manage.py loaddata ingredients`` without installing ``ingredients`` app in the project ``settings.py`` you will get the following error ``CommandError: No fixture named 'ingredients' found``. So make sure ``ingredients`` app has been put on the ``settings.py`` INSTALLED_APPS section before running ``$ python ./manage.py loaddata ingredients``.
Alternatively you can use the Django admin interface to create some data Alternatively you can use the Django admin interface to create some data
yourself. You'll need to run the development server (see below), and yourself. You'll need to run the development server (see below), and
create a login for yourself too (``./manage.py createsuperuser``). create a login for yourself too (``./manage.py createsuperuser``).
@ -193,7 +201,7 @@ a web-based integrated development environment to assist in the writing
and executing of GraphQL queries. It will provide us with a simple and and executing of GraphQL queries. It will provide us with a simple and
easy way of testing our cookbook project. easy way of testing our cookbook project.
Add ``ingredients`` and ``graphene_django`` to ``INSTALLED_APPS`` in ``cookbook/settings.py``: Add ``graphene_django`` to ``INSTALLED_APPS`` in ``cookbook/settings.py``:
.. code:: python .. code:: python
@ -201,9 +209,6 @@ Add ``ingredients`` and ``graphene_django`` to ``INSTALLED_APPS`` in ``cookbook/
... ...
# This will also make the `graphql_schema` management command available # This will also make the `graphql_schema` management command available
'graphene_django', 'graphene_django',
# Install the ingredients app
'ingredients',
] ]
And then add the ``SCHEMA`` to the ``GRAPHENE`` config in ``cookbook/settings.py``: And then add the ``SCHEMA`` to the ``GRAPHENE`` config in ``cookbook/settings.py``: