Create a new Django project

To start a new Django project, your local computer should be satisfied with the prerequisites are given above. Users can use the below command to start a new project.

django-admin startproject newslatter

Next, Go to the project directory.

cd newslatter

Django – How to add multiple submit button in single form?

Prerequisites:

When we submit the data using the HTML form, it sends the data to the server at a particular URL which is defined in the action attribute. To perform different actions with a single HTML form, we just need to add multiple submit buttons in the form. For example, If you go through the code of the newsletter app, you will find subscribe and unsubscribe buttons in a single HTML form but both perform different actions. 

In this tutorial, we are going to make a newsletter app using Django. We will add subscribe and unsubscribe buttons in a single HTML form. Moreover, We will add or remove the email address of the user from our database according to the user clicks on the subscribe or unsubscribe button.

To create the simple newsletter Django app, follow the below steps.

Similar Reads

Create a new Django project

To start a new Django project, your local computer should be satisfied with the prerequisites are given above. Users can use the below command to start a new project....

Start a newsletter app

To start a new app inside the newsletter project, run the below command inside the project directory....

Contact Us