Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Start Project | Get Started
course content

Зміст курсу

Django: Build Your First Website

Start ProjectStart 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;

Image 1
Image 2
Image 3

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.
notes in the commands below is the name of the django project. If you named your project differently, remember to change the project name in the terminal commands.

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?

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

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

Секція 1. Розділ 3
course content

Зміст курсу

Django: Build Your First Website

Start ProjectStart 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;

Image 1
Image 2
Image 3

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.
notes in the commands below is the name of the django project. If you named your project differently, remember to change the project name in the terminal commands.

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?

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

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

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