Continued from Initial Settings
This time, I decided to add an application called "posts". (* It seems that it is customary to pluralize the application name.)
$ python3.6 manage.py startapp posts
Doing this will create a posts folder in the project1 folder.
If you check the contents of apps.py created in the posts folder, it will be as follows.
apps.py
from django.apps import AppConfig
class PostsConfig(AppConfig):
name = 'posts'
Set this PostConfig class so that it can be called from the project. Open settings.py and add it to "INSTALLED_APPS". Add it as "folder name.file name.class name".
settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'posts.apps.PostsConfig', #Newly added line
]
(* At this time, it may be better to add ",".)
Recommended Posts