The first thing that comes to mind after seeing the welcome page of the development server is: How can we change it? To create our own welcome page, we need to define an entry point to our application in the form of a URL and tell Django to call a particular Python function when a visitor accesses this URL. We will write this Python function ourselves, and make it display our own welcome message.
A view in Django terminology is a regular Python function that responds to a page request by generating the corresponding page. To write our first Django view for the main page, we first need to create a Django application inside our project. You can think of an application as a container for views and data models. To create it, issue the following command within our django_bookmarks
folder:
$ python manage.py startapp bookmarks
The syntax of application creation is very similar to that of project creation. We used startapp
as the...