Creating the interface for the share feature

We will implement the form feature, which, in essence, is another view in our blog application. To do this, perform the following steps:

  1. First, create a new Python script inside the blog folder in the directory, as follows:
from django import formsclass EmailPostForm(forms.Form):    name = forms.CharField(max_length=25)    email = forms.EmailField()    to = forms.EmailField()    comments = forms.CharField(required=False, widget=forms.Textarea)

You can see that this file resembles a model declaration in Django; while the basic implementation is similar, Django forms are organized in the directory, separate from models. Here, we can see that, once again, Django offers an easy and straightforward ...

Get Hands-On Application Development with PyCharm now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.