Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
URLs | The First Application
Django: Build Your First Website

URLsURLs

URL (Uniform Resource Locator) is an address that points to the location of a resource on the internet, such as a web page, image, video, or other file. A URL consists of several parts:

  • Protocol: This is the initial part of the URL that indicates the type of protocol used to access the resource. The most common protocol is HTTP (HyperText Transfer Protocol) or HTTPS (HTTP Secure), but others;
  • The your-server.com/ is an address to the server;
  • Everything following, for example, storage/list, constitutes parts of the URL address, representing specific pages on a given website. This portion of the URL triggers corresponding functionality on the server-side of the application to send the necessary data for that page.

This distribution allows for clear site navigation and logical separation of server functionality for future updates.

URLs and Views

When a user navigates to a URL in Django, Django compares the URL to the URLs that have been defined in the urls.py file. If the URL matches one of the URLs defined in the urls.py file, Django triggers the function that is responsible for handling that URL.

Functions that are responsible for handling URLs are called views. Views can be defined in the views.py file.

What is the purpose of the portion following the server address in a URL, such as storage/list?

Select the correct answer

Everything was clear?

Section 2. Chapter 2
course content

Course Content

Django: Build Your First Website

URLsURLs

URL (Uniform Resource Locator) is an address that points to the location of a resource on the internet, such as a web page, image, video, or other file. A URL consists of several parts:

  • Protocol: This is the initial part of the URL that indicates the type of protocol used to access the resource. The most common protocol is HTTP (HyperText Transfer Protocol) or HTTPS (HTTP Secure), but others;
  • The your-server.com/ is an address to the server;
  • Everything following, for example, storage/list, constitutes parts of the URL address, representing specific pages on a given website. This portion of the URL triggers corresponding functionality on the server-side of the application to send the necessary data for that page.

This distribution allows for clear site navigation and logical separation of server functionality for future updates.

URLs and Views

When a user navigates to a URL in Django, Django compares the URL to the URLs that have been defined in the urls.py file. If the URL matches one of the URLs defined in the urls.py file, Django triggers the function that is responsible for handling that URL.

Functions that are responsible for handling URLs are called views. Views can be defined in the views.py file.

What is the purpose of the portion following the server address in a URL, such as storage/list?

Select the correct answer

Everything was clear?

Section 2. Chapter 2
some-alt