PyCharm 2024.3 Help

Create a Django application in a project

Enable the Django plugin

This functionality relies on the Django plugin, which is bundled and enabled in PyCharm by default. If the relevant features are not available, make sure that you did not disable the plugin.

  1. Press Ctrl+Alt+S to open settings and then select Plugins.

  2. Open the Installed tab, find the Django plugin, and select the checkbox next to the plugin name.

To add a new application to your existing Django project, you can either open the manage.py console and execute the startapp task manually, or use the Django Structure tool window.

Add a new app to the Django project

  1. Do one of the following:

    • Go to Tools | Run manage.py task or press Ctrl+Alt+R.

      The manage.py utility starts in a terminal tab, type startapp.

      Running the startapp command
    • Click New Django App in the toolbar of the Django Structure tool window.

      Creating a Django app in the Django Structure tool window
  2. Specify the name of the app and press Enter.

    Adding a new Django application to the project
  3. The app directory with the required files is added to the project structure.

    Second Django application

    The app is also added to INSTALLED_APPS in settings.py.

    Second Django application added in settings.py
Last modified: 17 June 2024