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
course content

Course Content

Django: Build Your First Website

Django: Build Your First Website

1. Get Started
2. The First Application
3. Models
4. CRUD Operations
5. Templates
6. Forms and Dynamic URLs

book
URLs

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`?

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?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 2
We're sorry to hear that something went wrong. What happened?
some-alt