January 2018
Intermediate to advanced
326 pages
7h 38m
English
After we create our first Django project and then a Django app, there are many new folders and files. First, use your favorite editor or IDE to check the Python code in the apps.py file within the restful01/toys folder (restful01\toys in Windows). The following lines show the code for this file:
from django.apps import AppConfig
class ToysConfig(AppConfig):
name = 'toys'
The code declares the ToysConfig class as a subclass of the django.apps.AppConfig class that represents a Django application and its configuration. The ToysConfig class just defines the name class attribute and sets its value to 'toys'.
Now, we have to add toys.apps.ToysConfig as one of the installed apps in the restful01/settings.py ...