Adding a news app
Do you remember how to add an app, add a model, and then display objects from the admin database? Try it on your own as a challenge.
Have you tried it? Let's now go through it together. To add a news
app, run the following in the Terminal:
- macOS:
python3 manage.py startapp news
- Windows:
python manage.py startapp news
A news
folder will be added to the project.
/moviereviews/settings.py
Each time we add an app, we have to tell Django about it by adding it to moviereviews/settings.py
:
… INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'movie', ...