Part 6. Django-specific navigation
Jumping from a view to a template
Open the file views.py for editing F4. In the gutter, next to the line
template_name = "polls/index.html", you see the icon .
Hovering the mouse pointer over this icon reveals the following popup:
Clicking this icon results in jumping directly to the template index.html, that resides in the folder polls under templates:
Jumping from a template to a view
In the gutter of the template file index.html, you see the icon . If you hover your mouse pointer over this icon, you'll see the following popup:
Clicking this icon leads you directly to the corresponding view.
Jumping between views and urls.py file
PyCharm allows you to easily navigate between a particular view and the corresponding url. This is how it's done:
Hover your mouse pointer over the view name, while keeping Ctrl key pressed, and see the view name turning into a hyperlink:
If you click this hyperlink, you'll jump directly to the corresponding URL:
Vice versa, you can also jump from a URL to the corresponding view. Again, in the urls.py file, hover your mouse pointer over the view name, while keeping Ctrl key pressed, and see the view name turning into a hyperlink.
Ctrl+Click the view name - and find yourself in the corresponding view.
By the way, if you click a pin icon in the popup, this popup becomes "pinned" - that is, turns into a tool window: