PyCharm 2021.1 Help

Django

File | Settings | Languages and Frameworks | Django for Windows and Linux
PyCharm | Preferences | Languages and Frameworks | Django for macOS
Ctrl+Alt+S

Use this page to configure Django support for each of the projects opened in the same window.

Projects pane

ItemDescription
Projects

This pane displays the list of projects, opened in the same window. The first project in the list is the primary project.

Django support pane

ItemDescription
Enable Django supportThe default state of this checkbox depends on the project type. For the empty projects, Django support is disabled. For the Django projects it is enabled by default; you can clear this checkbox if required. In this case, the other fields become unavailable.
Django project rootBy default, this field shows the directory that stores settings.py and manage.py files of the application. If required, you can specify a different location.
Settings

Click the browse button to select the desired settings file.

Use one of the following approaches:

  • This can be any file with the name matching *settings*.py, located under the Django project root.

  • Point to any Python package and store settings in __init__.py.
    This latter approach is useful when you want to split settings to several modules and import them.

By default, PyCharm shows the settings.py file, located under the Django project root.

Do not use Django test runnerBy default, this checkbox is not selected. You can select it if you want to use any of the alternative test runners specified in the PyCharm Integrated Tools dialog window (File | Settings | Tools | Python Integrated Tools for Windows and Linux and PyCharm | Preferences | Tools | Python Integrated Tools for macOS).
Manage.py tasks
Manage scriptSpecify here the desired manage.py file for the current project.
By default, PyCharm shows the manage.py file, located under the Django project root. Click the Browse button to select the desired manage file from the file system.
Environment variablesSpecify here the environment variables to be passed to the script.
Folder pattern to track fileSpecify here folder names separated with colons. If needed, you can use Glob-style wildcards. Django only pulls and adds to VCS files matched by this pattern.
Show structure

Click this button to show the structure of a Django project:

Project structure

The users are advised to look into this window to see whether the Django project structure is correct.

Last modified: 08 March 2021