IntelliJ IDEA 2020.2 Help

Creating Django Project

Django project is intended for productive web development with Django. IntelliJ IDEA takes care of creating specific directory structure and files required for a Django application, and providing the correct settings.

Create a new Django project

  1. From the main menu, choose File | New | Project, or click the New Project button in the Welcome screen. New Project dialog opens.

  2. In the New Project dialog, select Python as a project type.

  3. Select a Python SDK that has the Django support enabled. If no Python SDK is detected, create it as explained in Configuring Python SDK.

    Select the Django checkbox in the Additional Libraries and Frameworks area.

    Create a Django project: select an SDK
  4. Specify the following project settings:

    • From the Template language list, select the language to be used.

    • In the Templates folder field, specify the directory where the templates will be stored, and where they will be loaded from. You can specify the name of the directory that doesn't yet exist; in this case, the directory will be created.

    • In the Application name field, type the name of the created Django application.

    • If necessary, select the checkbox Enable Django admin. If you need admin interface to be created, select the Enable Django admincheckbox.

    Click Next to proceed.

  5. Skip a step for creating a project from a template, and specify project name and its location.

    Create a Django project: specify the project settings

    Click Finish.

If you have any Django project sources created outside of IntelliJ IDEA, you can import them to continue your work in IntelliJ IDEA.

Import an existing Django project

  1. On the Welcome screen, select Import project.

  2. Select Create project from existing sources and click Next.

    Import project: create a Django project from existing sources
  3. Specify the project name and its location; keep the project format .idea (directory based), then click Next.

    Django project details
  4. Confirm the selected sources to be included into the project and click Finish.

    Include Django sources into the project
  5. From the main menu, select File | Project Structure... | Modules. Click the Add Module icon (Add) and select Import Module.

    Import a Django module
  6. Complete all the steps in the project wizard. They should be identical to what you've already performed when creating a Django project. Once you press Finish, your Django project will be added as a new module.

  7. Ensure that Django setting are properly configured; add any missing files.

    Django module settings

    Click Show structure to preview the application structure.

Last modified: 02 July 2020