Inserting information into the database
We are now ready with an almost empty project but perfectly configured with Channels, rendering a simple static HTML. The first step is to INSERT
or save new information in the database. For this, we need a minimum of HTML. We are going to include a form with two fields: name
and message
. We will also leave a space to show the future messages that we list.
Create an HTML file in app/website/templates/index.html
with the following content.
First, we will incorporate a CSS file and a JavaScript file. For the moment, we incorporate the files in the headers:
{% load static %} <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, ...