Django not only used for making websites, rather than it is used for creating web applications. Django can be used to create dynamic high-security web applications.
Django is an open source web application framework, written in Python. A web framework that is a set of components that helps to develop websites faster and easier.
For authentication, one of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface.
Step 1: django-admin startproject mysite
Step 2: python manage.py startapp webapp
Step 3: To create the first view,
Open the file webapp/views.py
We import the class HttpResponse from the django.http module to render to the specific html pages.
The view returns an HttpResponse object that contains the generated response. Each view function is responsible for returning an HttpResponse object.
Step 4: In the next step to specify the root, URLconf at the webapp/urls.py path,
we need to write:
We have specified the paths for admin, index and home.
Step 5: To run the app, we have to write:
$ Python manage.py runserver
Step 6: For migration, to create the tables in the database, we need to write the command:
$ Python manage.py migrate
Step 7: To create the models we will write:
here we have created models for Question, Choice and Board.
Finally the output is: