O'Reilly logo

Learning Django Web Development by Ratan Kumar, Sanjeev Jaiswal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

URLs and views – creating the main page

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_mytweets folder:

$ python manage.py startapp tweets

The syntax of application creation is very similar to that of project creation. We used the startapp command as the first parameter of the python manage.py command, and provided tweets as the name of our application.

After running this command, Django will create a folder named tweets ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required