官术网_书友最值得收藏!

  • Django 2 by Example
  • Antonio Melé
  • 124字
  • 2021-06-25 21:19:03

Sharing posts by email

First, we will allow users to share posts by sending them emails. Take a short time to think how you would use views, URLs, and templates to create this functionality using what you have learned in the preceding chapter. Now, check what you need in order to allow your users to send posts by email. You will need to do the following things:

  • Create a form for users to fill in their name and email, the email recipient, and optional comments
  • Create a view in the views.py file that handles the posted data and sends the email
  • Add a URL pattern for the new view in the urls.py file of the blog application
  • Create a template to display the form
主站蜘蛛池模板: 朔州市| 岑溪市| 家居| 郑州市| 湖南省| 台江县| 古丈县| 明溪县| 平泉县| 平凉市| 岐山县| 鹤庆县| 株洲市| 盐城市| 临江市| 陵川县| 潮安县| 柏乡县| 泌阳县| 西青区| 陈巴尔虎旗| 崇信县| 新乡市| 麻阳| 古蔺县| 曲周县| 金沙县| 天祝| 阳东县| 呈贡县| 定西市| 克拉玛依市| 新田县| 墨玉县| 大兴区| 石阡县| 米脂县| 左贡县| 四子王旗| 衢州市| 通许县|