Skip to content

TPI: Improve debug config selection in Django #279

Closed
@paulacamargo25

Description

@paulacamargo25

Refs: #161

Complexity: 3

Create Issue


Automatically detect a Django file, and show it.

Steps

  1. Open a Django Project if you already have one or you can also create one following the steps in the Django Tutorial.
  2. Head over to the Run And Debug tab, and click on create a launch.json file.
Screenshot 2024-03-24 at 11 31 32 AM
  1. A window will open with a list of options, choose Python Debugger > Django.

Verification

  1. Valid django file
    1. Verifies that your manage.py file was found correctly and is displayed in the list.
    2. When you hover the item, verify that there is a button to open the file and that it works correctly.
    3. Select this option and verify that a launch.json configuration is created with the choose option.
  2. Invalid django file (you can delete or change the name of the file)
    1. Since no file was found, verify that a Default option is displayed.
    2. Select this option and verify that a launch.json configuration is created with the choose option.
  3. Browse a file
    1. Click on the option Browse Files... and select the file that you want.
    2. Verify that a launch.json configuration is created with the choose option, and that the path has been parsed correctly.
  4. Add own value
    1. You can also include your own text, type a path in the input box and press enter.
    2. Verify that a launch.json configuration is created with the choose option.

Notes

Django's application detection works by looking for the manage.py/app.py file in the root or in a subdirectory just one level lower. So you can try moving the manage.py file one level lower and check that it still appears.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions