To complete the recipe, follow these steps:
- Ensure that the template system will be able to find customized templates in our app by adding django.forms to our INSTALLED_APPS, using the DjangoTemplates backend for the TEMPLATES setting, and including the APP_DIRS flag as True for that engine. Aside from adding django.forms, these are the defaults when starting a new project:
# settings.py or config/base.py# ...INSTALLED_APPS = [ # ... 'django.forms',]# ...TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates ', 'APP_DIRS': True, # ... }]
- Create BulletinForm in forms.py, as follows:
# bulletin_board/forms.pyfrom django import formsfrom django.forms.renderers import TemplatesSettingfrom bulletin_board.models ...