PyCharm 2024.1 Help

Manage Endpoints

Enable the Django plugin

This functionality relies on the Django plugin, which is bundled and enabled in PyCharm by default. If the relevant features aren't available, make sure that you didn't 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.

You can preview, modify, create, and test endpoints of your Django REST Framework application.

  1. Make sure the Endpoints plugin is enabled in the settings. Press Ctrl+Alt+S to open settings and then select Plugins. Click the Installed tab. In the search field, type Endpoints. For more information about plugins, refer to Managing plugins.

  2. Select View | Tool Windows | Endpoints to open the Endpoints tool window.

    Alternatively, click More tool windows More tool windows on the left, and then select Endpoints.

  3. The Endpoints tool window contains the list of endpoints defined in the application.

    The dedicated pane shows the details of the selected endpoint including the documentation, the generated HTTP requests, examples, and the generated OpenAPI specification.

    Double-click any endpoint in the list to navigate to its declaration. You can also right-click any item in the list to open the context menu.

    Endpoint context menu
  4. Use coding assistance to create and modify endpoints:

    • Code completion

      PyCharm completes endpoint names as you are typing them in Python files, HTTP clients, and other project files.

      Code completion in the HTTP client
    • Live templates

      With the live templates available for HTTP clients, you can quickly modify request methods, URLs, and variables.

      Live templates for an HTTP client
    • Refactoring

      If you need to rename an endpoint, use the Rename refactoring. Select an endpoint in the editor, press Shift+F6, and type its new name.

      Renaming an endpoint

      Renaming happens in all occurrences across the project.

  5. To open the HTTP client in a separate tab, click Open in Editor on the HTTP Client tab. PyCharm opens a temporary scratch file with the HTTP request. Use Run an HTTP request in the gutter to run the request.

  6. Click the icon in the gutter to manage an endpoint.

    You can test an endpoint by running the request in the HTTP Client, view all lower-level endpoints, navigate one level up, or copy the URL to the clipboard.

    Manage an endpoint

For more information, refer to Endpoints tool window.

Last modified: 17 June 2024