PyCharm 2017.2 Help

Project

Basics

Whatever you do in PyCharm, you do that in the context of a project. A project is an organizational unit that represents a complete software solution. It serves as a basis for coding assistance, bulk refactoring, coding style consistency, etc.

Project files

A project in PyCharm is represented in the Directory Based Format. A project directory is marked with /help/img/idea/2017.2/project_icon.png icon.

Such project directory contains the .idea directory, with the following files:

  • *.iml file that describes the project structure.
  • workspace.xml file that contains your workspace preferences.
  • A number of .xml files. Each .xml file is responsible for its own set of settings, that can be recognized by its name: projectCodeStyle.xml, encodings.xml, vcs.xml etc.

    Thus, for example, adding a new run/debug configuration and changing encoding will affect two different .xml files. This helps avoid merge conflicts when the project settings are stored in a version control system and modified by the different team members.

All the settings files in the .idea directory should be put under version control except the workspace.xml, which stores your local preferences. The workspace.xml file should be marked as ignored by VCS.

.idea directory is not visible in the Project view of the Project Tool Window.

Note: when a source or header file is not included into either CMake target and is not located under the source or library roots, CLion notifies you about it:

/help/img/idea/2017.2/cl_fileWIldMessage.png
You can experience an incorrect behavior of such features like syntax highlighting, refactoring, code navigation etc. for such a file until you specify that file as a project one explicitly. To do that use one of the following approaches:
  1. Include a file into SOURCE_FILES variable of set () command in CMakeLists.txt file. For our example it should look as follows:
    set (SOURCE FILES main.cpp hello.cpp hello.h extrdef.h). For more details, refer to our Quick CMake Tutorial.
  2. Use #include preprocessor directive in the respective source files.
  3. For a library header files, specify the header search paths so that the IDE can index the respective directories and provide code completion and navigation facilities on #include statements:
    include_directories( ${MY_LIBRARY_DIR}) For more details, refer to our Quick CMake Tutorial .

Project types

The directory structure of each project contains the .idea directory for the PyCharm-specific settings and the project file, and libraries.

PyCharm suggests the following types of projects:

  • Empty project is intended for pure Python programming. The directory structure of such project contains the .idea directory for the PyCharm-specific settings and the project file, and libraries.

    Create a plain Python project as described in the section .

  • Django project. This project type provides specific infrastructure of the Django applications, and all the necessary files and settings.

    Create a Django application as described in the section Creating Django Project.

  • Google App Engine project. This project type provides specific infrastructure of the Google App Engine application, and all the necessary files and settings.

    Create project as described in the section Creating Google App Engine Project.

  • Flask project. This project type provides specific infrastructure of a Flask application, and all the necessary files and settings.

    Create project as described in the section Creating Flask Project.

  • Web2Py project. This project type provides specific infrastructure of a Web2Py application, and all the necessary files and settings.

    Create project as described in the section Creating Web2Py Project.

  • Pyramid project. This project type provides specific infrastructure of a Pyramid application, and all the necessary files and settings.

    Create project as described in the section Creating Pyramid Project.

  • Client-side projects HTML5 Boilerplate, Twitter Bootstrap, and Foundation.

    For the client-side applications, PyCharm creates specific infrastructure, with the required files and directories.

    Create project as described in the section Creating Projects from Scratch in PyCharm.

See Also

Last modified: 26 July 2017