How to do it...

To complete the recipe, follow these steps:

  1. 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,        # ...    }]
  1. Create BulletinForm in forms.py, as follows:
# bulletin_board/forms.pyfrom django import formsfrom django.forms.renderers import TemplatesSettingfrom bulletin_board.models ...

Get Django 2 Web Development Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.