Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Start Project | Get Started
Django: Build Your First Website
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

bookStart Project

Terminal

The terminal in PyCharm is an integrated terminal that allows developers to execute commands, run scripts, manage dependencies, and interact with version control directly within the IDE. It provides a convenient way to work with the command line without leaving the development environment.

In this chapter, we will use the terminal to install Django and run a test local server.

Follow the instructions to create a Django project:

Install Django

Step 1. Open PyCharm and create new project;

Step 2. Install Django using the following command:

If the command above doesn't work, try inputting this pip3 install django.

Django Project

Step 3. Initialize a new Django project using the following command:

  • The command django-admin startproject notes is used to create a new Django project with the name notes;
  • I named my project notes, you can name your project whatever you like.

Development Server

Step 4. Running test server:

  • Go to app folder:
  • Run development server:

If the command above doesn't work, try inputting this python3 manage.py runserver.

This command starts the development server, allowing you to test and preview your Django application locally.

After running this command, you should see output indicating that the server is running. By default, the server will be available at http://127.0.0.1:8000/ in your web browser.

To stop the local server:

  • Ctrl + C in the terminal: If you started the server from the terminal, simply press the Ctrl + C key combination. This will stop the server;
  • Closing the terminal: If the server is running in the terminal, simply close the terminal window or command prompt where it is running. This will also stop the server.
What does the `django-admin startproject notes` command do?

What does the django-admin startproject notes command do?

Виберіть правильну відповідь

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 3
some-alt